You are viewing a single comment's thread. Return to all comments →
here's my c++ solution
do { current = n & 1 ? current + 1 : 0; max = current > max ? current : max; } while (n >>= 1);
Seems like cookies are disabled on this browser, please enable them to open this website
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
here's my c++ solution