371. Sum of Two Integers
来源:互联网 发布:下载蜜蜂软件 编辑:程序博客网 时间:2024/06/06 02:08
371. Sum of Two Integers
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.
解1:
厉害了,不使用加减,计算两个整数的和。
那么是否可以使用operator模块中的add,好贱啊,哈哈哈, 居然通过了,机智如我。
class Solution(object): def getSum(self, a, b): """ :type a: int :type b: int :rtype: int """ return operator.add(a,b)
0 0
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 371. Sum of Two Integers
- 大菠萝实习日记(1)
- mysql(四)Innodb的聚簇索引
- Java多线程与网络编程
- 数据库事务与锁
- 深入理解Java注解
- 371. Sum of Two Integers
- 2017年05月12日 学习小总结(think php 验证码的使用)
- woj 656. Wifi Relay 【prim 大稠密图】
- GCC内置原子性操作
- node.js 和npm的安装及关系
- 商品类目管理
- POJ2823(单调队列初步)
- 157.n1-模仿微信下边点击不同的模块切换不同的界面
- 通俗易懂的 android framework