Leetcode
yuluoxuanyuan1992
这个作者很懒,什么都没留下…
展开
-
Leetcode:1.Two Sum
Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution.Example: Given nums = [2,原创 2016-09-14 15:07:57 · 186 阅读 · 0 评论 -
Leetcode:2. Add Two Numbers
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 digit. Add the two numbers and return it as a linke原创 2016-09-14 19:42:59 · 162 阅读 · 0 评论 -
Leetcode :3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”, with the le原创 2016-09-17 20:09:49 · 186 阅读 · 0 评论 -
Leetcode:4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 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)).Example 1: nums1 = [1, 3] num原创 2016-09-17 20:12:12 · 182 阅读 · 0 评论