2 Comments
User's avatar
anish singla's avatar

in the example for value = 8 shouldn't the length be 5?

thank you for this, it was really interesting and well written. Especially for me , because i could read it one go.

Expand full comment
Sourav Tripathy's avatar

yes, it will be of 5 bits i.e 10110 which is 22 by calculation as per the algorithm.

Expand full comment