Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luojiyin1987/5e084ff7a25e017cfaba23c92156bb19 to your computer and use it in GitHub Desktop.
Save luojiyin1987/5e084ff7a25e017cfaba23c92156bb19 to your computer and use it in GitHub Desktop.
Sum of Two Integers
func getSum(a int, b int) int {
for b != 0 {
c := a & b
a ^=b
b = c<<1
}
return a
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment