戳我去解题You are climbing a stair case. It
takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In
how many distinct ways can you ...
分类:
其他好文 时间:
2014-05-15 01:55:06
阅读次数:
251
Series Determination
题目描述
Boudreaux and Thibodeaux aren't very good at math, so they need you to write a program that can de...
分类:
其他好文 时间:
2014-05-15 01:28:56
阅读次数:
313
题意:给定一组数和另一个数,在这组数中找两个数,使它们的和等于给定的数
思路1: --> 错,因为题目要求返回下标。
1.排序
2.两个下标,一个指向头,一个指向尾
3.如果下标指向的两个元素相加大于给定的数,尾下标减一
如果小于,头下标加一
思路2: hash
1.用hash存储每个数的下标
2.数组,看hash[target-num[i]]是否存在
复杂度:时间O(n), 空间O(n)...
分类:
其他好文 时间:
2014-05-15 01:28:13
阅读次数:
297
Description
Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the Universit...
分类:
其他好文 时间:
2014-05-15 00:20:39
阅读次数:
332
Linked List Cycle
Total Accepted: 17148 Total
Submissions: 49300My Submissions
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra sp...
分类:
其他好文 时间:
2014-05-15 00:13:50
阅读次数:
279
[ 问题: ]
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 the two numbers such that they add up to the ta...
分类:
其他好文 时间:
2014-05-15 00:04:39
阅读次数:
377
Linked List CycleGiven a linked list, determine
if it has a cycle in it.Follow up:Can you solve it without using extra
space?做完Linked List Cycle II在做这...
分类:
其他好文 时间:
2014-05-14 23:30:00
阅读次数:
399
Given two numbers represented as strings,
return multiplication of the numbers as a string.Note: The numbers can be
arbitrarily large and are non-nega...
分类:
其他好文 时间:
2014-05-14 23:11:14
阅读次数:
398
重定向dup和dup2函数[cpp] view
plaincopyprint?#includeintdup(intfile_descriptor);intdup2(intfile_descriptor_one,intfile_descriptor_two);dup创建一个新的文件描述符,
此描述符和...
分类:
系统相关 时间:
2014-05-14 22:34:09
阅读次数:
479