leetcode
文章平均质量分 65
laymenISmouse
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Two Sum
Given 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-17 19:42:46 · 352 阅读 · 0 评论 -
3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain du原创 2016-12-03 08:36:10 · 339 阅读 · 0 评论 -
3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly原创 2016-12-03 10:18:19 · 377 阅读 · 0 评论 -
Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string转载 2016-12-04 14:36:42 · 347 阅读 · 0 评论 -
ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I原创 2016-11-27 10:29:24 · 340 阅读 · 0 评论 -
Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Subscribe to see which companies asked this question原创 2016-11-27 17:39:08 · 422 阅读 · 0 评论 -
String to Integer (atoi)(将字符窜转换成数字)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case原创 2016-11-27 22:54:52 · 431 阅读 · 0 评论 -
Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Subscribe to see which companies asked this question原创 2016-11-28 08:50:14 · 340 阅读 · 0 评论 -
Longest Palindromic Substring(最长回文)
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Ex原创 2016-11-26 19:22:43 · 369 阅读 · 0 评论 -
Longest Common Prefix (最长公共前缀)
Write a function to find the longest common prefix string amongst an array of strings. Subscribe to see which companies asked this question原创 2016-12-01 13:19:04 · 460 阅读 · 0 评论 -
Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid b转载 2016-12-10 17:41:25 · 367 阅读 · 0 评论 -
Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the l原创 2016-12-10 16:22:05 · 291 阅读 · 0 评论 -
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原创 2016-09-20 12:23:56 · 348 阅读 · 0 评论 -
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 link原创 2016-09-18 08:40:38 · 333 阅读 · 0 评论 -
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,原创 2016-09-23 11:21:33 · 394 阅读 · 0 评论 -
Regular Expression Matching
'.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). The function prototype should be: bool isMatch(c转载 2016-11-28 20:09:10 · 419 阅读 · 0 评论 -
Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find原创 2016-11-29 15:38:47 · 362 阅读 · 0 评论 -
Integer to Roman
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. Subscribe to see which companies asked this question原创 2016-11-30 16:06:39 · 287 阅读 · 0 评论 -
Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. Subscribe to see which companies asked this question原创 2016-11-30 17:58:08 · 289 阅读 · 0 评论 -
4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution s原创 2016-12-10 15:03:15 · 307 阅读 · 0 评论 -
Merge Two Sorted Lists 默认初始是按顺序排列的
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Subscribe to see which companies asked this question p原创 2016-12-12 19:14:27 · 524 阅读 · 0 评论
分享