说明:以下解题,如果没有说明,我的解法的运行效率基本在LeetCode的排名在靠前位置,如果LeetCode有更好的解法,我会在解法中有说明,或者附上排名靠前的解法。LeetCode里面使用sync_with_stdio开启输出流加速的方式提高自己解法的旁门,不太推荐,有违刷题本意。
- 1. Two Sum
- 2. Add Two Number
- 4. Median of Two Sorted Array
- 6. ZigZag Conversion
- 7. Reverse Integer
- 8. String to Integer(Atoi)
- 9. Palindrome Number
- 11. Container With Most Water
- 12. Integer to Roman
- 13. Roman to Integer
- 14. Longest Common Prefix
- 15. 3Sum
- 17. Letter Combinations of Phone Number
- 18. 4 Sum
- 19. Remove Nth Node From End of List
- 20. Valid Parantheses
- 21. Merge Two Sorted Lists
- 22. Generate Parenthese
- 23. Merge k Sorted Lists
- 24. Swap Nodes in Pairs
- 25. Reverse Nodes in k-Group
- 26. Remove Duplicates from Sorted Array
- 27. Remove Elements
- 28. Implement strStr()
- 29. Devide Two Integers
- 30. Substring with Concatenation of Words
- 31. Next Permutation
- 32. Longest Valid Parenthese
- 33. Search in Rotated Sorted Array
- 34. Find First and Last Element in Sorted Array
- 35. Search Insert Position
- 36. Valid Sudoku
- 37. Sudoku Solver
- 38. Count and Say
- 39. Combination Sum
- 40. Combination Sum II
- 41. First Missing Positive
- 91. Decode Ways
- 367. Valid Perfect Square
- 389. Find the Difference
- 394. Decode String
- 415. Add Strings
- 424. Longest Repeating Character Replacement
- 429. N-ary Tree Level Order Traversal
- 441. Arranging Coins
- 448. Find All Numbers Disappeared in an Array
- 501. Find Mode in Binary Tree
- 506. Relative Ranks
- 507. Perfect Number
- 520. Detect Capital
- 709. To Lower Case
- 762. Prime Number of Set Bits in Binary Representation
- 859. Buddy Strings
- 860. Lemonade Change
- 867. Transpose Matrix
- 872. Leaf-Similar Trees
- 908. Smallest Range I
- 914. X of a Kind in a Deck of Cards
- 915. Partition Array into Disjoint Intervals