Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".算法思路:模拟二进制加法,跟十进制木有区别,将a,b转置(不转置的话,倒着...
分类:
其他好文 时间:
2014-07-24 22:57:23
阅读次数:
216
To import the library to Android Studio, there is two methods that can (or cannot) work. The first one worked for me, but when I tried the second, it ...
分类:
移动开发 时间:
2014-07-24 22:42:13
阅读次数:
284
Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of t...
分类:
其他好文 时间:
2014-07-24 22:32:52
阅读次数:
194
Divide two integers without using multiplication, division and mod operator.题解:要求不用乘除和取模运算实现两个数的除法。那么用加减法是很自然的选择。不过如果一次只从被除数中剪掉一个除数会TLE。所以我们借助移位运算,依次从...
分类:
其他好文 时间:
2014-07-24 17:09:15
阅读次数:
203
本文翻译自JavaScript’s two zerosJavaScript has two zeros: ?0 and +0. This post explains why that is and where it matters in practice.JavaScript 中有两个“0”: -0...
分类:
编程语言 时间:
2014-07-24 10:18:03
阅读次数:
454
总时间限制:1000ms内存限制:65536kB描述Calculate a + b输入Two integer a,,b (0 ≤ a,b ≤ 10)输出Output a + b样例输入1 2样例输出3提示Q: Where are the input and the output?A: Your pr...
分类:
其他好文 时间:
2014-07-24 10:07:23
阅读次数:
287
Snowflake Snow SnowflakesTime Limit: 4000MSMemory Limit: 65536KTotal Submissions: 30652Accepted: 8076DescriptionYou may have heard that no two snowfla...
分类:
其他好文 时间:
2014-07-24 10:04:03
阅读次数:
283
题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sin....
分类:
编程语言 时间:
2014-07-24 10:01:23
阅读次数:
223
Gray CodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the tot...
分类:
其他好文 时间:
2014-07-24 00:53:27
阅读次数:
198
1.hashMap方法O(n)空间换时间public class Solution { public int[] twoSum(int[] numbers, int target) { HashMap hash=new HashMap(); int ans[]=ne...
分类:
其他好文 时间:
2014-07-23 22:20:57
阅读次数:
262