leetcode/lcci/05.06.Convert Integer/Solution.go

3 lines
81 B
Go

func convertInteger(A int, B int) int {
return bits.OnesCount32(uint32(A ^ B))
}