Skip to content

Commit

Permalink
Create: 371-Sum-of-Two-Integers.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Ykhan799 authored Sep 13, 2022
1 parent 4c65d1b commit 9e82845
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions go/371-Sum-of-Two-Integers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
func getSum(a int, b int) int {
for b != 0 {
temp := (a & b) << 1
a = (a ^ b)
b = temp
}
return a
}

0 comments on commit 9e82845

Please sign in to comment.