Feedback for BOX95 problem

Problem Link: BOX95 Problem - CodeChef


the minimum no. of boxes to empty is (n/2) + (n%2); where ‘n’ is the number of elements with leftmost set bit position is maximum leftmost set bit. now the we have to check if there is a case where complete pairing is not possible, if so answer will be (n-1) / 2 + ((n-1) % 2) + 1.

lets take an example 7 7 7 7 3 3 2
leftmost set bit position is 2 and n=4 (7s)
take one of the 7 and place it in a new box followed by 3 2 3(in any order it wont matter as box will always have xor>=4 as leftmost bit of 7 cant change)
at the end this box will have xor=5
so other three 7s will make groups of two as xoring them would unset the leftmost bit
so the boxes will be
[2,3,3,7] [7,7] [7]