Problem Link : Problem
Initially unable to solve it I went through editorial, then found that it tells that answer is the count of set bits. Although I get the intuition, but can we prove that counting the bits would give the minimal answer? Please help, thanks in advance.
My Solution : MySubmission



