[leetcode] online judge题目汇总
最近在LeetCode在线评测系统上进行刷题练习,并完成了约一半的题目量(132道题中完成了约一半),积累了一些心得体会。然而该平台存在一些不足之处:首先该平台缺乏合理的题目分类(即没有明确的章节划分),导致学习起来头绪不清;其次平台未能提供清晰的题目难度标识(即无法根据难度进行筛选),使得新手难以循序渐进地提升;此外平台也没有提供完整的解题思路讲解功能(即无法帮助用户深入理解解题方法),因此对于新手来说难以循序渐进地提升。
- 1星:基础练习题。从技术层面来看并没有很大难度, 主要目的是帮助巩固编码基础, 同时需要特别注意边界条件处理(例如数据越界情况, 参数为空或无效(如字符串为空、链表为NULL等)等情况)。
- 2星:类似于教材中的简单课后练习题, 解决这类问题通常可以直接套用已有的标准算法框架, 关键在于选择恰当的解决方案。
- 3星:有一定的难度, 可能涉及一些经典的算法变种情况. 在解决问题时通常需要结合特定场景进行分析, 并在应用标准算法的基础上进行适当调整(例如对结果集进行去重处理等); 同时还需要具备一定的编程技巧来优化实现细节。
- 4星:具有一定挑战性的题目. 解决这类问题通常需要经历两个阶段: 首先是对问题进行建模分析, 确定适合的技术路线; 其次是在实现过程中结合特定场景进行优化和调试.
- 5星:目前尚未遇到过此类题目, 只作为理论上的上限存在. 在实际应用中可能会遇到更加复杂的问题场景.
从整体上看,在三大类算法中涉及BackTracking、Tree相关以及List相关的题目数量最多;而动态规划的题目相对较少;这可能与尚未完善有关。
今天对一些内容进行了整理,并将solution上传至GitHub平台。
BackTracking
[**] Generate Parentheses
[**] Restore IP Addresses
[**] Letter Combinations of a Phone Number
[**] Permutations
[**] Combination Sum
[**] Subsets
[***] Word Ladder
[***] Permutations II
[***] Combination Sum II
[***] Word Ladder II
[****] Sudoku Solver
Tree
[*]Maximum Depth of Binary Tree
**]Binary Tree Zigzag Level Order Traversal
Build a binary tree based on its Inorder and Postorder traversals.
为每个节点设置Next Right指针的问题页面链接为为每个节点设置Next Right指针
Filling Next Right Child Pointers for Every Second Node
Convert a Binary Search Tree into a Linked List structure.
Transform a Sorted Array into a Binary Search Tree.
Binary Trees’ Breadth-First Search
List
Eliminate Repeated Elements in a Sorted Sequence
将有序链表转换为二叉搜索树
[***]Remove Duplicates from Sorted List II
Remove Nth Node From End of List
String
[**] Interleaving String
[**] Length of Last Word
[**] Longest Substring Without Repeating Characters [Solution]
Minimum Window Substring [Solution]
该函数用于字符串查找。(来自LeetCode在线判断系统中的问题列表)
Dynamic Programming
[**] Maximum Subarray
[***] Palindrome Partitioning II
The problem of identifying the longest palindromic substring is a classic challenge in computer science. It involves finding the longest substring within a given string that reads the same forwards and backwards, which has significant applications in areas such as string algorithms and bioinformatics. The solution to this problem typically employs dynamic programming or expand-around-center techniques to efficiently determine the maximum length palindrome. This concept is fundamental for understanding more complex string manipulation problems and has been extensively studied in algorithm courses.
Greedy
[**] Jump Game
[**] Jump Game II
Other
[*] Reverse Integer
[*] Pow(x, n)
[*] Valid Sudoku
[*] Valid Palindrome
[*] Remove Element
[*] Best Time to Buy and Sell Stock
[*] Two Sum
[*] Add Binary
[*] Remove Duplicates from Sorted Array
[**] Triangle
Best Time to Buy and Sell Stock II
[**] Sort Colors
[**] Minimum Path Sum
[**] Insert Interval
[**] Merge Intervals
[**] Next Permutation
[**] Divide Two Integers
[**] 3Sum
[**] 4Sum
