Leetcode 1497. Check If Array Pairs Are Divisible by k
Determine whether the array can be paired so every pair sums to a multiple of k by looking at element remainders mod k: you must be able to match counts of remainder r with counts of k−r (and ensure counts for remainder 0 — and r = k/2 when k is even — are even), accounting for negative values via modulo normalization.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.