LeetCode 解题

LeetCode上的题目都是面试中常遇到的,涉及到一些很基础的算法,也不像ACM。

以下是我做过的LeetCode上的题目。不断更新==

有可能由于个人读题跑偏而使代码虽然AC,但是不符合题目的要求,比如用常数内存啥的。欢迎指正。

每个汇总20题。实现代码为C++/python

汇总一

  1. Triangle
  2. Gray Code
  3. Maximum Depth of Binary Tree
  4. Add Two Numbers
  5. Merge Sorted Array
  6. First Missing Positive
  7. Binary Tree Level Order Traversal
  8. Add Binary
  9. Pascals Triangle
  10. Merge k Sorted Lists
  11. Candy
  12. Sum
  13. Single Number
  14. Remove Nth Node From End of List
  15. ZigZag Conversion
  16. Rotate Image
  17. Merge Two Sorted Lists
  18. Text Justification
  19. Reverse Words in a String
  20. Evaluate Reverse Polish Notation
汇总二

  1. Jump Game II
  2. Combinations
  3. Swap Nodes in Pairs
  4. Remove Duplicates from Sorted List
  5. Two Sum
  6. Path Sum
  7. Path Sum II
  8. Single Number II
  9. Jump Game
  10. Combination Sum II
  11. Combination Sum
  12. Remove Duplicates from Sorted Array
  13. Remove Element
  14. Remove Duplicates from Sorted Array II
  15. Unique Paths
  16. Unique Paths II
  17. Binary Tree Preorder Traversal
  18. Binary Tree Postorder Traversal
  19. Surrounded Regions
  20. Word Search
汇总三

  1. Climbing Stairs
  2. Longest Substring Without Repeating Characters
  3. Reverse Integer
  4. N-Queens
  5. Largest Rectangle in Histogram
  6. Valid Palindrome
  7. Longest Valid Parentheses
  8. Merge Intervals
  9. Divide Two Integers
  10. Palindrome Number
  11. Valid Parentheses
  12. Spiral Matrix II
  13. Spiral Matrix
  14. Search a 2D Matrix
  15. Binary Tree Inorder Traversal
  16. Maximum Subarray
  17. Minimum Depth of Binary Tree
  18. Integer to Roman
  19. Sort Colors
  20. Remove Duplicates from Sorted List II

汇总四

  1. Permutations
  2. Length of Last Word
  3. Linked List Cycle
  4. Maximal Rectangle
  5. Linked List Cycle II
  6. Longest Common Prefix
  7. Binary Tree Maximum Path Sum
  8. Best Time to Buy and Sell Stock
  9. Best Time to Buy and Sell Stock II
  10. Best Time to Buy and Sell Stock III
  11. Linked List Cycle
  12. Search in Rotated Sorted Array
  13. Container With Most Water
  14. Unique Binary Search Trees
  15. Insertion Sort List
  16. First Missing Positive
  17. Sum Root to Leaf Numbers
  18. Set Matrix Zeroes
  19. Restore IP Addresses
  20. Search Insert Position

汇总五




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值