leetcode
文章平均质量分 70
shzxrt
算法初学者,c++初学者,IT初学者。处于学习阶段,博文有错误之处还望指正。
展开
-
String to Integer (atoi)
String to Integer (atoi)原创 2014-06-06 09:31:41 · 496 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
Longest Substring Without Repeating Characters原创 2014-05-26 15:56:54 · 360 阅读 · 0 评论 -
leetcode Add Two Numbers
Add Two NumbersYou 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 an原创 2014-05-28 10:26:52 · 515 阅读 · 0 评论 -
Reverse Integer
Reverse IntegerReverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Have you thought about this?Here are some good questions to ask before coding. Bonus原创 2014-05-31 08:36:13 · 509 阅读 · 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 NA P L S I I原创 2014-05-30 11:46:43 · 589 阅读 · 0 评论 -
Generate Parentheses
Generate Parentheses转载 2014-06-13 23:33:43 · 461 阅读 · 0 评论 -
Longest Palindromic Substring
Longest Palindromic Substring原创 2014-05-30 11:17:03 · 701 阅读 · 0 评论 -
Swap Nodes in Pairs
Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use o原创 2014-06-17 18:22:24 · 531 阅读 · 0 评论 -
Reverse Nodes in k-Group
Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in th原创 2014-06-17 18:49:21 · 521 阅读 · 0 评论 -
Merge k Sorted Lists
Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.转载 2014-06-17 17:28:47 · 536 阅读 · 0 评论 -
Remove Duplicates from Sorted Array
Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space for anoth原创 2014-06-18 09:40:09 · 597 阅读 · 2 评论 -
Remove Element
Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond th原创 2014-06-18 10:02:14 · 463 阅读 · 0 评论 -
leetcode Median of Two Sorted Arrays
Median of Two Sorted Arrays原创 2014-05-25 11:22:56 · 449 阅读 · 0 评论 -
3Sum
3SumGiven 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:Elements in a triplet原创 2014-06-08 12:12:06 · 482 阅读 · 0 评论 -
Integer to Roman
Integer to Roman原创 2014-06-08 11:39:53 · 538 阅读 · 0 评论 -
leetcode Two Sum
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原创 2014-05-23 10:57:50 · 452 阅读 · 0 评论 -
Container With Most Water
Container With Most Water原创 2014-06-08 11:14:50 · 412 阅读 · 0 评论 -
3Sum Closest
3Sum ClosestGiven 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原创 2014-06-08 22:41:52 · 758 阅读 · 0 评论 -
4Sum
4SumGiven 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:原创 2014-06-08 22:46:51 · 442 阅读 · 0 评论 -
Letter Combinations of a Phone Number
Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone but原创 2014-06-08 22:51:57 · 536 阅读 · 0 评论 -
Remove Nth Node From End of List
Remove Nth Node From End of ListGiven 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 removi原创 2014-06-08 23:11:27 · 439 阅读 · 0 评论 -
Roman to Integer
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.原创 2014-06-08 11:49:24 · 437 阅读 · 0 评论 -
Valid Parentheses
Valid ParenthesesGiven a string containing just the characters '(', ')','{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "原创 2014-06-08 23:23:42 · 469 阅读 · 0 评论 -
Regular Expression Matching
Regular Expression Matching转载 2014-06-07 17:54:38 · 454 阅读 · 0 评论 -
Longest Common Prefix
Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.遍历原创 2014-06-08 11:54:43 · 438 阅读 · 0 评论 -
Palindrome Number
Palindrome Number原创 2014-06-07 10:43:48 · 419 阅读 · 0 评论 -
Implement strStr()
Implement strStr()Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.原创 2014-06-18 10:57:09 · 478 阅读 · 0 评论