【LeetCode】 371. Sum of Two Integers
来源:互联网 发布:动态网页制作python 编辑:程序博客网 时间:2024/06/05 15:44
Calculate the sum of two integers a and b, but you are not allowed to use the operator +
and -
.
Example:
Given a = 1 and b = 2, return 3.
public class Solution { public int getSum(int a, int b) { if (a == 0) { return b; } if (b == 0) { return a; } while (b != 0) { int carry = a & b; a = a ^ b; b = carry << 1; } return a; }}
0 0
- LeetCode 371. Sum of Two Integers
- 371. Sum of Two Integers LeetCode OJ
- [Leetcode]371. Sum of Two Integers
- LeetCode - 371. Sum of Two Integers
- <LeetCode OJ> 371. Sum of Two Integers
- LeetCode 371. Sum of Two Integers
- leetcode 371. Sum of Two Integers
- leetcode 371.Sum of Two Integers
- LeetCode 371. Sum of Two Integers
- 371. Sum of Two Integers(Leetcode)
- leetcode 371. Sum of Two Integers
- 【leetcode】371. Sum of Two Integers【E】
- [leetcode] 371. Sum of Two Integers
- leetcode.371. Sum of Two Integers
- 371. Sum of Two Integers--LeetCode Record
- LeetCode—371. Sum of Two Integers
- Leetcode 371. Sum of Two Integers
- LeetCode 371. Sum of Two Integers
- 编程之美-线下分享总结篇
- MySQL(2):表的建立及常用数据类型
- 移植最新的内核linux-4.9到开发板JZ2440全过程笔记
- map gene to chromosome
- ubuntu16 编译openwrt
- 【LeetCode】 371. Sum of Two Integers
- TransferFile
- 集合框架_ArrayList存储自定义对象并遍历泛型版
- jquery多个相同ID动态绑定同一事件
- tempalte.js例子
- 使用sed、awk命令生成.java或.yaml文件所需语句
- 初学HTML用法大全指导(一)html对文本的设置
- Crashing Robots(POJ 2632)(模拟)
- JAVA 16方格排序游戏