You are viewing a single comment's thread. Return to all comments →
Here is my thought process:
Now is the fun part. I first thought it was a DP, but it was much easier. Each pair i+j = k -> choose the one with more elements
with i = 0 and i = k // 2 -> either 1 or 0
o(k/2)
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 →
Here is my thought process:
Now is the fun part. I first thought it was a DP, but it was much easier. Each pair i+j = k -> choose the one with more elements
with i = 0 and i = k // 2 -> either 1 or 0
o(k/2)