Longest subarray with elements divisible by k - GeeksforGeeks
Suppose you a given an array. You have to find the length of the longest subarray such that each and every element of it is divisible by k.
Examples:
Input : arr[] = { 1, 7, 2, 6, 8, 100, 3, 6, 16}, k=2 Output : 4 Input : arr[] = { 3, 11, 22, 32, 55, 100, 1, 5}, k=5 Output : 2
Read full article from Longest subarray with elements divisible by k - GeeksforGeeks
No comments:
Post a Comment