Guys,

         A very important doubt - I think this problem cannot have a
solution if we have a constraint that a maximum of 15 ONES can be set
at any point of time since if at any point of time you have set 15 ONES
-> the last ONE cannot be toggled according to condition 2. In order to
toggle it, you have set the bit before it to ONE. Now, for the new bit
that you set - you are again at the same situation !!!! . So you have
lost 1 ONE.  In this way, you will start losing more and more ONE's and
I guess - you will already hit the limit of UTMOST 15 ONE's.

        Please show me where I am wrong.
Thanks,
Hemanth

Reply via email to