弱问一道G题# JobHunting - 待字闺中
c*t
1 楼
Write a program to determine whether n/2 distintinctve pairs can be formed
from given n integers where n is even and each pair's sum is divisible by
given k. Numbers cannot be repeated in the pairs, that means only you can
form total n/2 pairs.
我想到的方法
find num%k for each number in the array and sum them. If it is divisible by
K then we have n/2 pairs
被鄙视了。为什么?
from given n integers where n is even and each pair's sum is divisible by
given k. Numbers cannot be repeated in the pairs, that means only you can
form total n/2 pairs.
我想到的方法
find num%k for each number in the array and sum them. If it is divisible by
K then we have n/2 pairs
被鄙视了。为什么?