You are viewing a single comment's thread. Return to all comments →
def nonDivisibleSubset(k, s): freq_s = [0] * k for num in s: freq_s[num%k] += 1
result = min(freq_s[0], 1) for i in range(1, k//2 + 1): if i != k - i: result += max(freq_s[i], freq_s[k - i]) else: result += 1 return result
i use group z_k to solve this pr
Seems like cookies are disabled on this browser, please enable them to open this website
Non-Divisible Subset
You are viewing a single comment's thread. Return to all comments →
def nonDivisibleSubset(k, s): freq_s = [0] * k for num in s: freq_s[num%k] += 1
i use group z_k to solve this pr