Easy
class Solution { fun hammingWeight(n: Int): Int { var x = n var c = 0 while (x != 0) { x = x and (x - 1) c++ } return c } }