1497. Check If Array Pairs Are Divisible by k
https://leetcode.com/problems/check-if-array-pairs-are-divisible-by-k
Description
Given an array of integers arr
of even length n
and an integer k
.
We want to divide the array into exactly n / 2
pairs such that the sum of each pair is divisible by k
.
Return True If you can find a way to do that or False otherwise.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
arr.length == n
1 <= n <= 105
n
is even.-109 <= arr[i] <= 109
1 <= k <= 105
ac
Last updated