Saved from https://leetcode-cn.com/problems/number-complement/submissions/
func findComplement(num int) int { bit := uint(0) for { n := 1 << bit if n > num { return n - 1 - num } bit++ } }