• + 0 comments

    here's my c++ solution

        do {
            current = n & 1 ? current + 1 : 0;
            max = current > max ? current : max;
        } while (n >>= 1);