### LeetCode题解

https://leetcode.com/，笔者自己做的LeetCode中题目的详细解答，代码暂定C++，以后会加入python。希望对自己和大家有所帮助，算法这东西，不能丢~

0 已关注
16篇博文
• #### [C++]LeetCode 28: Implement strStr() （实现strStr()函数）

Problem: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -...

2015-05-19 21:16
287
• #### [C++]LeetCode 12: Integer to Roman（将整数转换为罗马数字）

Problem: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the rang...

2015-05-19 21:08
387
• #### [C++]LeetCode 11: Container With Most Water（最大容积/最大矩形面积）

Problem: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate...

2015-05-19 20:57
485
• #### [C++]LeetCode 5: Longest Palindromic Substring（最长回文子串）

Problem: Given a string S, find the longest palindromic substring in S. You may assume that the max...

2015-05-19 16:46
267
• #### [C++]LeetCode 27: Remove Element（删除数组中指定元素）

Problem: Given an array and a value, remove all instances of that value in place and return the new ...

2015-05-03 09:59
1026
• #### [C++]LeetCode 26: Remove Duplicates from Sorted Array（有序数组去重）

Problem: Given a sorted array, remove the duplicates in place such that each element appear only onc...

2015-05-02 21:43
414
• #### [C++]LeetCode 21: Merge Two Sorted Lists（合并链表）

Problem: Merge two sorted linked lists and return it as a new list. The new list should be made by s...

2015-05-02 21:15
241
• #### [C++]LeetCode 20: Valid Parentheses（判断运算符有效性）

Problem: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine i...

2015-05-02 20:53
276
• #### [C++]LeetCode 19: Remove Nth Node From End of List（删除链表中倒数第n个节点）

Problem： Given a linked list, remove the nth node from the end of list and return its head. For exam...

2015-05-02 20:23
268
• #### [C++]LeetCode 14: Longest Common Prefix（最长公共前缀）

Problem: Write a function to find the longest common prefix string amongst an array of strings. 分...

2015-05-02 19:19
543
• #### [C++]LeetCode 9: Palindrome Number（判断整数是否是回文数）

Problem: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Coul...

2015-05-02 15:42
881
• #### [C++]LeetCode 8:String to Integer (atoi)（字符串转int）

Problem： Implement atoi to convert a string to an integer. Hint: Carefully consider all possible inp...

2015-05-02 14:36
235
• #### [C++]LeetCode 6: ZigZag Conversion（ZigZag排序）

Problem: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like...

2015-04-29 22:20
302
• #### [C++]LeetCode 3: Longest Substring Without Repeating Characters（最长不重复子串）

Problem: Given a string, find the length of the longest substring without repeating characters. For ...

2015-04-29 09:44
288
• #### [C++]LeetCode 2: Add Two Numbers（链表逆序加法）

Problem: You are given two linked lists representing two non-negative numbers. The digits are stored...

2015-04-28 21:37
342
• #### [C++]LeetCode 1: Two Sum（无序数组求指定和）

Problem: Given an array of integers, find two numbers such that they add up to a specific target num...

2015-04-28 20:16
595