LeetCode
My C++ Code for LeetCode OJ
Install / Use
/learn @lzl124631x/LeetCodeREADME
LeetCode
Author: github.com/lzl124631x
My C++ Code for LeetCode OJ.
Please give this repo a :star: if it inspires you. Thanks. :blush:
😩 Hate manually copy & pasting the example testcases when solving LeetCode problems?
👉 Try my LeetCode Testcase Extractor
Now I'm using a Chrome Extension I developed -- LeetCoder -- to facilitate my having fun on LeetCode. Features including but not limited to:
- showing stats
- copying problem, answer and testcases
- randomly picking a problem.
# | Title | Difficulty | Solution ---|---|---|--- 1 | Two Sum | Easy | Solution 2 | Add Two Numbers | Medium | Solution 3 | Longest Substring Without Repeating Characters | Medium | Solution 4 | Median of Two Sorted Arrays | Hard | Solution 5 | Longest Palindromic Substring | Medium | Solution 6 | ZigZag Conversion | Medium | Solution 7 | Reverse Integer | Easy | Solution 8 | String to Integer (atoi) | Medium | Solution 9 | Palindrome Number | Easy | Solution 10 | Regular Expression Matching | Hard | Solution 11 | Container With Most Water | Medium | Solution 12 | Integer to Roman | Medium | Solution 13 | Roman to Integer | Easy | Solution 14 | Longest Common Prefix | Easy | Solution 15 | 3Sum | Medium | Solution 16 | 3Sum Closest | Medium | Solution 17 | Letter Combinations of a Phone Number | Medium | Solution 18 | 4Sum | Medium | Solution 19 | Remove Nth Node From End of List | Medium | Solution 20 | Valid Parentheses | Easy | Solution 21 | Merge Two Sorted Lists | Easy | Solution 22 | Generate Parentheses | Medium | Solution 23 | Merge k Sorted Lists | Hard | Solution 24 | Swap Nodes in Pairs | Medium | Solution 25 | Reverse Nodes in k-Group | Hard | Solution 26 | Remove Duplicates from Sorted Array | Easy | Solution 27 | Remove Element | Easy | Solution 28 | Implement strStr() | Easy | Solution 29 | Divide Two Integers | Medium | Solution 30 | Substring with Concatenation of All Words | Hard | Solution 31 | Next Permutation | Medium | Solution 32 | Longest Valid Parentheses | Hard | Solution 33 | Search in Rotated Sorted Array | Medium | Solution 34 | Find First and Last Position of Element in Sorted Array | Medium | Solution 35 | Search Insert Position | Easy | Solution 36 | Valid Sudoku | Medium | Solution 37 | Sudoku Solver | Hard | Solution 38 | Count and Say | Medium | Solution 39 | Combination Sum | Medium | Solution 40 | Combination Sum II | Medium | Solution 41 | First Missing Positive | Hard | Solution 42 | Trapping Rain Water | Hard | Solution 43 | Multiply Strings | Medium | Solution 44 | Wildcard Matching | Hard | Solution 45 | Jump Game II | Medium | Solution 46 | Permutations | Medium | Solution 47 | Permutations II | Medium | Solution 48 | Rotate Image | Medium | Solution 49 | Group Anagrams | Medium | Solution 50 | Pow(x, n) | Medium | Solution 51 | N-Queens | Hard | Solution 52 | N-Queens II | Hard | Solution 53 | Maximum Subarray | Easy | Solution 54 | Spiral Matrix | Medium | Solution 55 | Jump Game | Medium | Solution 56 | Merge Intervals | Medium | Solution 57 | Insert Interval | Hard | Solution 58 | Length of Last Word | Easy | Solution 59 | Spiral Matrix II | Medium | Solution 60 | Permutation Sequence | Hard | Solution 61 | Rotate List | Medium | Solution 62 | Unique Paths | Medium | Solution 63 | Unique Paths II | Medium | Solution 64 | Minimum Path Sum | Medium | Solution 65 | Valid Number | Hard | Solution 66 | Plus One | Easy | Solution 67 | Add Binary | Easy | Solution 68 | Text Justification | Hard | Solution 69 | Sqrt(x) | Easy | Solution 70 | Climbing Stairs | Easy | Solution 71 | Simplify Path | Medium | Solution 72 | Edit Distance | Hard | Solution 73 | Set Matrix Zeroes | Medium | Solution 74 | Search a 2D Matrix | Medium | Solution 75 | Sort Colors | Medium | Solution 76 | Minimum Window Substring | Hard | Solution 77 | Combinations | Medium | Solution 78 | Subsets | Medium | Solution 79 | Word Search | Medium | Solution 80 | Remove Duplicates from Sorted Array II | Medium | Solution 81 | Search in Rotated Sorted Array II | Medium | Solution 82 | Remove Duplicates from Sorted List II | Medium | Solution 83 | Remove Duplicates from Sorted List | Easy | Solution 84 | Largest Rectangle in Histogram | Hard | Solution 85 | Maximal Rectangle | Hard | Solution 86 | Partition List | Medium | Solution 87 | Scramble String | Hard | Solution 88 | Merge Sorted Array | Easy | Solution 89 | Gray Code | Medium | Solution 90 | Subsets II | Medium | Solution 91 | Decode Ways | Medium | Solution 92 | Reverse Linked List II | Medium | Solution 93 | Restore IP Addresses | Medium | Solution 94 | Binary Tree Inorder Traversal | Easy | Solution 95 | Unique Binary Search Trees II | Medium | Solution 96 | Unique Binary Search Trees | Medium | Solution 97 | Interleaving String | Medium | Solution 98 | Validate Binary Search Tree | Medium | Solution 99 | Recover Binary Search Tree | Hard | Solution 100 | Same Tree | Easy | Solution 101 | Symmetric Tree | Easy | Solution 102 | Binary Tree Level Order Traversal | Medium | Solution 103 | Binary Tree Zigzag Level Order Traversal | Medium | Solution 104 | Maximum Depth of Binary Tree | Easy | Solution 106 | Construct Binary Tree from Inorder and Postorder Traversal | Medium | Solution 107 | Binary Tree Level Order Traversal II | Medium | Solution 108 | Convert Sorted Array to Binary Search Tree | Easy | Solution 109 | Convert Sorted List to Binary Search Tree | Medium | Solution 110 | Balanced Binary Tree | Easy | Solution 111 | Minimum Depth of Binary Tree | Easy | Solution 112 | Path Sum | Easy | Solution 113 | Path Sum II | Medium | Solution 114 | Flatten Binary Tree to Linked List | Medium | Solution 115 | Distinct Subsequences | Hard | Solution 116 | Populating Next Right Pointers in Each Node | Medium | Solution 117 | Populating Next Right Pointers in Each Node II | Medium | Solution 118 | Pascal's Triangle | Easy | Solution 119 | Pascal's Triangle II | Easy | Solution 120 | Triangle | Medium | Solution 121 | Best Time to Buy and Sell Stock | Easy | Solution 122 | Best Time to Buy and Sell Stock II | Easy | Solution 123 | Best Time to Buy and Sell Stock III | Hard | Solution 124 | Binary Tree Maximum Path Sum | Hard | Solution 125 | Valid Palindrome | Easy | Solution 126 | Word Ladder II | Hard | Solution 127 | Word Ladder | Hard | Solution 128 | Longest Consecutive Sequence | Hard | Solution 129 | Sum Root to Leaf Numbers | Medium | Solution 130 | Surrounded Regions | Medium | Solution 131 | Palindrome Partitioning | Medium | Solution 132 | Palindrome Partitioning II | Hard | Solution 133 | Clone Graph | Medium | Solution 134 | Gas Station | Medium | Solution 135 | Candy | Hard | Solution 136 | Single Number | Easy | Solution 137 | Single Number II | Medium | Solution 138 | Copy List with Random Pointer | Medium | Solution 139 | Word Break | Medium | Solution 140 | Word Break II | Hard | Solution 141 | Linked List Cycle | Easy | Solution 142 | Linked List Cycle II | Medium | Solution 143 | Reorder List | Medium | Solution 144 | Binary Tree Preorder Traversal | Easy | Solution 145 | Binary Tree Postorder Traversal | Easy | Solution 146 | LRU Cache | Medium | Solution 147 | Insertion Sort List | Medium | Solution 148 | Sort List | Medium | Solution 149 | Max Points on a Line | Hard | Solution 150 | Evaluate Reverse Polish Notation | Medium | Solution 151 | Reverse Words in a String | Medium | Solution 152 | Maximum Product Subarray | Medium | Solution 153 | Find Minimum in Rotated Sorted Array | Medium | [Solution](leetcode/15
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
