0476.cpp (129B)
1 class Solution { 2 public: 3 int findComplement(unsigned num) const { return num ^ (0xFFFFFFFF >> std::countl_zero(num)); } 4 };