沉淀
LeetCode28. Implement strStr()
1
2
3
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

简单的做法双重循环,依次去比较,时间复杂度O(m*n)

LeetCode24. Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.

LeetCode70. Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.

LeetCode67. Add Binary

Given two binary strings, return their sum (also a binary string).

LeetCode39. Combination Sum

Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.

LeetCode22. Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

LeetCode20. Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

LeeCode19. Remove Nth Node From End of List

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

LeeCode18. 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.

LeeCode17. Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.