Given $$$n$$$ and $$$k$$$, Maximize $$$(a_1 + a_2 + \dots + a_k)$$$ such that $$$a_1 \oplus a_2 \oplus \dots \oplus a_k = n$$$ and $$$0 \leq a_i \leq n$$$.
I created a video discussing the concept of Tight in Bit manipulation and how to apply it to this problem







