摘要: Add Two Numbers 阅读全文
posted @ 2013-10-02 22:48 般若一号 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length of 1.解 阅读全文
posted @ 2013-10-02 22:46 般若一号 阅读(129) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).解决方法(C++版):class Solution {public:double findMedianSortedArrays(int A [], int m, int B [], int n) {int temp = m + n;if (temp & 0x1){r 阅读全文
posted @ 2013-10-02 22:42 般若一号 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 问题: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 target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) a 阅读全文
posted @ 2013-10-02 22:39 般若一号 阅读(163) 评论(0) 推荐(0) 编辑