Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".类似模拟十进制加法 1 class Solution { 2 public: 3 st...
分类:
其他好文 时间:
2014-10-07 00:00:40
阅读次数:
165
题目:Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the ...
分类:
其他好文 时间:
2014-10-06 18:31:30
阅读次数:
145
Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all distinc...
分类:
其他好文 时间:
2014-10-06 16:38:20
阅读次数:
249
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-10-06 13:11:00
阅读次数:
167
DescriptionThere are N cities and N-1 roads in Magic-Island. You can go from one city to any other. One road only connects two cities. One day, The ki...
分类:
其他好文 时间:
2014-10-06 02:45:19
阅读次数:
292
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 single ...
分类:
其他好文 时间:
2014-10-05 23:28:39
阅读次数:
357
struct Node{
int index;
int value;
};
bool compare(Node a, Node b)
{
return a.value < b.value;
}
class Solution {
public:
vector twoSum(vector &numbers, int target) {
...
分类:
其他好文 时间:
2014-10-05 22:56:39
阅读次数:
252
class Solution {
public:
int removeDuplicates(int A[], int n) {
int duplicate = 0;
int i = 0;
for(i = 0; i < n - 1; i++){
if(A[i] == A[i + 1]){
dupli...
分类:
其他好文 时间:
2014-10-05 22:23:09
阅读次数:
183
给定一个排好序的链表,删除所有重复的节点,使每一个节点都只出现一次...
分类:
其他好文 时间:
2014-10-05 21:17:09
阅读次数:
212