Solutions to high-frequency interview questions of LeetCode in C++17, taking into account both efficiency and comprehensibility.
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0026 | Remove Duplicates from Sorted Array | 删除排序数组中的重复项 | README | C++ |
0122 | Best Time to Buy and Sell Stock II | 买卖股票的最佳时机 II | README | C++ |
0189 | Rotate Array | 旋转数组 | README | C++ |
0217 | Contains Duplicate | 存在重复元素 | README | C++ |
0136 | Single Number | 只出现一次的数字 | README | C++ |
0350 | Intersection of Two Arrays II | 两个数组的交集 II | README | C++ |
0066 | Plus One | 加一 | README | C++ |
0283 | Move Zeroes | 移动零 | README | C++ |
0001 | Two Sum | 两数之和 | README | C++ |
0036 | Valid Sudoku | 有效的数独 | README | C++ |
0048 | Rotate Image | 旋转图像 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0344 | Reverse String | 反转字符串 | README | C++ |
0007 | Reverse Integer | 整数反转 | README | C++ |
0387 | First Unique Character in a String | 字符串中的第一个唯一字符 | README | C++ |
0242 | Valid Anagram | 有效的字母异位词 | README | C++ |
0125 | Valid Palindrome | 验证回文串 | README | C++ |
0008 | String to Integer (atoi) | 字符串转换整数 (atoi) | README | C++ |
0028 | Implement strStr() | 实现 strStr() | README | C++ |
0038 | Count and Say | 外观数列 | README | C++ |
0014 | Longest Common Prefix | 最长公共前缀 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0237 | Delete Node in a Linked List | 删除链表中的节点 | README | C++ |
0019 | Remove Nth Node From End of List | 删除链表的倒数第N个节点 | README | C++ |
0206 | Reverse Linked List | 反转链表 | README | C++ |
0021 | Merge Two Sorted Lists | 合并两个有序链表 | README | C++ |
0234 | Palindrome Linked List | 回文链表 | README | C++ |
0141 | Linked List Cycle | 环形链表 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0104 | Maximum Depth of Binary Tree | 二叉树的最大深度 | README | C++ |
0098 | Validate Binary Search Tree | 验证二叉搜索树 | README | C++ |
0101 | Symmetric Tree | 对称二叉树 | README | C++ |
0102 | Binary Tree Level Order Traversal | 二叉树的层序遍历 | README | C++ |
0108 | Convert Sorted Array to Binary Search Tree | 将有序数组转换为二叉搜索树 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0088 | Merge Sorted Array | 合并两个有序数组 | README | C++ |
0278 | First Bad Version | 第一个错误的版本 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0070 | Climbing Stairs | 爬楼梯 | README | C++ |
0121 | Best Time to Buy and Sell Stock | 买卖股票的最佳时机 | README | C++ |
0053 | Maximum Subarray | 最大子序和 | README | C++ |
0198 | House Robber | 打家劫舍 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0384 | Shuffle an Array | 打乱数组 | README | C++ |
0155 | Min Stack | 最小栈 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0412 | Fizz Buzz | Fizz Buzz | README | C++ |
0204 | Count Primes | 计数质数 | README | C++ |
0326 | Power of Three | 3的幂 | README | C++ |
0013 | Roman to Integer | 罗马数字转整数 | README | C++ |
# | Title | 中文站 | Solution | Code |
---|---|---|---|---|
0191 | Number of 1 Bits | 位1的个数 | README | C++ |
0461 | Hamming Distance | 汉明距离 | README | C++ |
0190 | Reverse Bits | 颠倒二进制位 | README | C++ |
0118 | Pascal’s Triangle | 杨辉三角 | README | C++ |
0020 | Valid Parentheses | 有效的括号 | README | C++ |
0268 | Missing Number | 缺失数字 | README | C++ |