说明:以下解题,如果没有说明,我的解法的运行效率基本在LeetCode的排名在靠前位置,如果LeetCode有更好的解法,我会在解法中有说明,或者附上排名靠前的解法。LeetCode里面使用sync_with_stdio开启输出流加速的方式提高自己解法的旁门,不太推荐,有违刷题本意。
- 1. Two Sum
- 2. Add Two Number
- 4. Median of Two Sorted Arrays
- 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 a Phone Number
- 18. 4 Sum
- 19. Remove Nth Node From End of List
- 20. Valid Parentheses
- 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 Position of 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
- 42. Trapping Rain Water
- 43. Multiply Strings
- 45. Jump Game II
- 46. Permutations
- 47. Permutation II
- 48. Rotate Image
- 49. Group Anagrams
- 50. Pow(x,n)
- 51. N-Queens
- 52. N-Queens II
- 53. Maximum SubArray
- 54. Spiral Matrix
- 55. Jump Game
- 56. Merge Interval
- 57. Insert Interval
- 58. Length of Last Word
- 59. Spiral Matrix II
- 60. Permutation Sequence
- 61. Rotate List
- 62. Unique Paths
- 63. Unique Paths
- 64. Minimun Path Sum
- 65. Valid Number
- 66. Plus One
- 67. Add Binary
- 68. Text Justification
- 69. Sqrt(x)
- 70. Climbing Stairs
- 71. Simplify Path
- 73. Set Matrix Zeros
- 74. Search a 2D Matrix
- 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
- 605:Can Place Flower
- 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
- 926. Flip String to Monotone Increasing
- 933. Number of Recent Calls
- 934. Shortest Bridge
- 935. Knight Dial