Medium20 pts
Non-Divisible Subset
Find max subset of S such that no two sum to a multiple of k.
Input
n k\nS[]
Output
Max size.
Sample
4 3 1 7 2 4
Expected
3
Loading editor…
Output
No output yet. Run your code to see results.
Find max subset of S such that no two sum to a multiple of k.
n k\nS[]
Max size.
4 3 1 7 2 4
3
Loading editor…
No output yet. Run your code to see results.