leetcode
newcica
True Strength is being able to hold it together when everyone is expecting you to fall apart.
展开
-
Sum of two integer number
题目:两个整型数组相减,不能使用“+”和“-”(注意:两数相加并不知道两个数字是正书还是负数)思路:在不能使用运算符号的条件下,只能考虑最底层的位运算方法:实现两数相加,但是不能用加号或者其他什么数学运算符号,那么我们只能回归计算机运算的本质,位操作Bit Manipulation,我们在做加法运算的时候,每位相加之后可能会有进位Carry产生,然后在下一位计算时需要加上进原创 2016-08-14 10:05:22 · 470 阅读 · 0 评论 -
leetcode,查找并移动某字符
问题:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after ca原创 2016-08-14 21:13:57 · 201 阅读 · 0 评论