Simplest Java Solution one line 2ms


  • 0
    N

    The solution gives thes same running time for the loop ansower given in the editorial but only one line of code:

    return Integer.bitCount(n);


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.