• + 0 comments

    Here is my thought process:

    1. Definitely turn the problem into modulo -> r_map[] size k + Counting
    2. 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

    3. with i = 0 and i = k // 2 -> either 1 or 0

    o(k/2)