LeetCode-Solutions-in-Cpp17

Solutions to high-frequency interview questions of LeetCode in C++17, taking into account both efficiency and comprehensibility.


Project maintained by downdemo Hosted on GitHub Pages — Theme by mattgraham

数组和字符串(Array and String)

# Title 中文站 Solution Code
0238 Product of Array Except Self 除自身以外数组的乘积 README C++
0054 Spiral Matrix 螺旋矩阵 README C++
0454 4Sum II 四数相加 II README C++
0011 Container With Most Water 盛最多水的容器 README C++
0289 Game of Life 生命游戏 README C++
0041 First Missing Positive 缺失的第一个正数 README C++
0128 Longest Consecutive Sequence 最长连续序列 README C++
0287 Find the Duplicate Number 寻找重复数 README C++
0227 Basic Calculator II 基本计算器 II README C++
0239 Sliding Window Maximum 滑动窗口最大值 README C++
0076 Minimum Window Substring 最小覆盖子串 README C++

链表(Linked List)

# Title 中文站 Solution Code
0023 Merge k Sorted Lists 合并K个排序链表 README C++
0148 Sort List 排序链表 README C++
0138 Copy List with Random Pointer 复制带随机指针的链表 README C++

树和图(Tree and Graph)

# Title 中文站 Solution Code
0127 Word Ladder 单词接龙 README C++
0130 Surrounded Regions 被围绕的区域 README C++
0236 Lowest Common Ancestor of a Binary Tree 二叉树的最近公共祖先 README C++
0124 Binary Tree Maximum Path Sum 二叉树中的最大路径和 README C++
0547 Friend Circles 朋友圈 README C++
0207 Course Schedule 课程表 README C++
0210 Course Schedule II 课程表 II README C++
0329 Longest Increasing Path in a Matrix 矩阵中的最长递增路径 README C++
0315 Count of Smaller Numbers After Self 计算右侧小于当前元素的个数 README C++

回溯算法(Backtracking)

# Title 中文站 Solution Code
0131 Palindrome Partitioning 分割回文串 README C++
0212 Word Search II 单词搜索 II README C++
0301 Remove Invalid Parentheses 删除无效的括号 README C++
0044 Wildcard Matching 通配符匹配 README C++
0010 Regular Expression Matching 正则表达式匹配 README C++

排序和搜索(Sorting and Searching)

# Title 中文站 Solution Code
0324 Wiggle Sort II 摆动排序 II README C++
0378 Kth Smallest Element in a Sorted Matrix 有序矩阵中第K小的元素 README C++
0004 Median of Two Sorted Arrays 寻找两个有序数组的中位数 README C++

动态规划(Dynamic Programming)

# Title 中文站 Solution Code
0152 Maximum Product Subarray 乘积最大子数组 README C++
0309 Best Time to Buy and Sell Stock with Cooldown 最佳买卖股票时机含冷冻期 README C++
0279 Perfect Squares 完全平方数 README C++
0139 Word Break 单词拆分 README C++
0140 Word Break II 单词拆分 II README C++
0312 Burst Balloons 戳气球 README C++

设计问题(Design)

# Title 中文站 Solution Code
0146 LRU Cache LRU缓存机制 README C++
0208 Implement Trie (Prefix Tree) 实现 Trie (前缀树) README C++
0341 Flatten Nested List Iterator 扁平化嵌套列表迭代器 README C++
0295 Find Median from Data Stream 数据流的中位数 README C++

数学(Math)

# Title 中文站 Solution Code
0179 Largest Number 最大数 README C++
0149 Max Points on a Line 直线上最多的点数 README C++

其他(Other)

# Title 中文站 Solution Code
0406 Queue Reconstruction by Height 根据身高重建队列 README C++
0042 Trapping Rain Water 接雨水 README C++
0218 The Skyline Problem 天际线问题 README C++
0084 Largest Rectangle in Histogram 柱状图中最大的矩形 README C++