Description
Solutions
Submission
Nums That Are Divisible by N 🍋
🤘 INTERN
The agency is giving you an int num named N and an arr of ints called arr[n].
Ur task -
Example 1:
Input: N = 3, arr = [5, 4, 3, 2, 1]
Output: 4
Explanation:We can that there are FOUR pairs that meet the criteria outlined in task 1 through task 3 above 👆 arr[0] + arr[1] = 1 + 2 = 3, 3 ➗ 3 = 1 arr[0] + arr[4] = 1 + 5 = 6, 6 ➗ 3 = 2 arr[1] + arr[3] = 2 + 4 = 6, 6 ➗ 3 = 2 arr[3] + arr[4] = 4 + 5 = 9, 9 ➗ 3 = 3 So, 4 should be returned. For original prompt, pls refer source image.
Constraints:
1 <= N <= 109
1 <= len of arr <= 105
1 <= arr[i] <= 109
Related Problems
Testcase
Result
Case 1
input:
output: