371.sum-of-two-integers.go 84 B

123456
  1. func getSum(a int, b int) int {
  2. for b != 0 {
  3. a, b = a^b, (a&b)<<1
  4. }
  5. return a
  6. }