Longest Subarray With Sum Divisible By K
easy
1. You are given an array of integers(arr) and a number K. 2. You have to find length of the longest subarray whose sum is divisible by K.
Constraints
1 <= N,K <= 10^5 -1000 <= arr[i] <= 1000
Format
Input
A number N arr1 arr2.. N numbers A number K
Output
A number representing length of the longest subarray whose sum is divisible by K.
Example
Sample Input
6
2 7 6 1 4 5
3
Sample Output
4
Question Video