A local C# console application for practicing LeetCode problems in your own IDE. Say goodbye to LeetCode's online editor and hello to VS Code!
- Local Development: Write solutions in VS Code with all your favorite extensions
- Multi-Language Support: Practice in C# or TypeScript β more languages can be added following the same pattern
- Automatic Scaffolding: Generate new C# problem files directly from LeetCode data with one command
- Automatic Testing: Built-in test runner with formatted output and performance stats
- Problem Management: Easy CLI commands to run, test, and manage problems
- Solution Resetting: Quickly reset one or all solutions back to their initial state
- Clean Output: Pretty-printed test results with pass/fail status
- .NET 10.0 SDK
- VS Code (recommended)
git clone <your-repo-url>
cd BeetCode
dotnet build# Generate a new problem file from LeetCode
dotnet run -- scaffold 1
# Run tests for a specific problem
dotnet run -- test 1
# Show problem info and run tests
dotnet run -- run 1
# Show just the problem description
dotnet run -- info 1
# List all available problems and your progress
dotnet run -- list
# Reset a solution
dotnet run -- reset 1
# Show help
dotnet run -- helpBeetCode/
βββ Framework/
β βββ LeetCodeClient.cs # Fetches problem data from LeetCode
β βββ Problem.cs # Abstract base class for all problems
β βββ ResetHelper.cs # Utility for resetting solutions
β βββ ScaffoldGenerator.cs # Generates C# boilerplate from problem data
β βββ TestCase.cs # Test case data structure
β βββ TestRunner.cs # Test execution engine
βββ Problems/
β βββ Problem001.cs # Two Sum
β βββ Problem002.cs # Add Two Numbers
β βββ ... # More problems as you add them
βββ Program.cs # CLI entry point
βββ README.md # You are here!
Want to practice a new LeetCode problem? Use the scaffold command:
dotnet run -- scaffold 1This will automatically create a complete problem file with:
- Problem description, difficulty, and examples
- Method signature ready for your solution
- Integration into the test runner
Note: Some problems may require manual adjustment of test cases if the data format is complex.
- Scaffold a problem:
dotnet run -- scaffold 1 - Read the description:
dotnet run -- info 1 - Open the file: Edit
Problems/Problem001.cs - Write your solution: Replace the
NotImplementedException - Test it:
dotnet run -- test 1 - Celebrate: π (when all tests pass)
$ dotnet run -- test 1
Running tests for Problem 1: Two Sum
--------------------------------------------------
Example 1: PASS
Example 2: PASS
Example 3: PASS
--------------------------------------------------
Results: 3/3 tests passed
All tests passed! π| Command | Description | Example |
|---|---|---|
scaffold <n> |
Generate problem file from LeetCode | dotnet run -- scaffold 1 |
test <n> |
Run tests for a problem | dotnet run -- test 1 |
run <n> |
Show info + run tests | dotnet run -- run 1 |
info <n> |
Show problem description | dotnet run -- info 1 |
list |
List all problems and progress | dotnet run -- list |
reset <n> |
Reset a specific solution | dotnet run -- reset 1 |
reset |
Reset ALL solutions (prompts) | dotnet run -- reset |
update-data |
Refresh local LeetCode problem cache | dotnet run -- update-data |
help |
Show help message | dotnet run -- help |
- Your IDE, Your Rules: Use VS Code with IntelliSense, debugging, and extensions
- Version Control: Track your solution progress with Git
- Offline Practice: No internet required once problems are set up
- Custom Testing: Add your own test cases beyond LeetCode examples
- Learning Focus: Clean, distraction-free environment for problem-solving
This is a personal practice tool, but feel free to:
- Suggest new framework features
- Report bugs or improvements
- Share your favorite problem templates
MIT License - Practice away! π
Total Solved: 22
| Set | Easy | Medium | Hard | Total |
|---|---|---|---|---|
| 21 / 28 | 0 / 100 | 0 / 20 | 21 / 148 |
β
217 Β· Contains Duplicate
β
242 Β· Valid Anagram
β
1 Β· Two Sum
π² 26 Β· Remove Duplicates from Sorted Array
π² 27 Β· Remove Element
π² 383 Β· Ransom Note
π² 414 Β· Third Maximum Number
β
125 Β· Valid Palindrome
π² 344 Β· Reverse String
β
121 Β· Best Time to Buy and Sell Stock
β
20 Β· Valid Parentheses
π² 13 Β· Roman to Integer
π² 14 Β· Longest Common Prefix
π² 28 Β· Find the Index of the First Occurrence in a String
π² 58 Β· Length of Last Word
π² 168 Β· Excel Sheet Column Title
β
704 Β· Binary Search
β
206 Β· Reverse Linked List
β
141 Β· Linked List Cycle
β
21 Β· Merge Two Sorted Lists
β
226 Β· Invert Binary Tree
β
104 Β· Maximum Depth of Binary Tree
β
543 Β· Diameter of Binary Tree
β
110 Β· Balanced Binary Tree
β
100 Β· Same Tree
β
572 Β· Subtree of Another Tree
β
703 Β· Kth Largest Element in a Stream
β
1046 Β· Last Stone Weight
β
70 Β· Climbing Stairs
β
746 Β· Min Cost Climbing Stairs
π² 252 Β· Meeting Rooms (Premium)
β
202 Β· Happy Number
π² 66 Β· Plus One
π² 9 Β· Palindrome Number
π² 258 Β· Add Digits
β 412 Β· Fizz Buzz
π² 136 Β· Single Number
π² 191 Β· Number of 1 Bits
π² 338 Β· Counting Bits
π² 190 Β· Reverse Bits
π² 268 Β· Missing Number
π² 389 Β· Find the Difference
π² 49 Β· Group Anagrams
π² 347 Β· Top K Frequent Elements
π² 238 Β· Product of Array Except Self
π² 36 Β· Valid Sudoku
π² 271 Β· Encode and Decode Strings (Premium)
π² 128 Β· Longest Consecutive Sequence
π² 167 Β· Two Sum II - Input Array Is Sorted
π² 15 Β· 3Sum
π² 11 Β· Container With Most Water
π² 3 Β· Longest Substring Without Repeating Characters
π² 424 Β· Longest Repeating Character Replacement
π² 567 Β· Permutation in String
π² 155 Β· Min Stack
π² 150 Β· Evaluate Reverse Polish Notation
π² 22 Β· Generate Parentheses
π² 739 Β· Daily Temperatures
π² 853 Β· Car Fleet
π² 74 Β· Search a 2D Matrix
π² 875 Β· Koko Eating Bananas
π² 153 Β· Find Minimum in Rotated Sorted Array
π² 33 Β· Search in Rotated Sorted Array
π² 981 Β· Time Based Key-Value Store
π² 143 Β· Reorder List
π² 19 Β· Remove Nth Node From End of List
π² 138 Β· Copy List With Random Pointer
π² 2 Β· Add Two Numbers
π² 287 Β· Find the Duplicate Number
π² 146 Β· LRU Cache
π² 235 Β· Lowest Common Ancestor of BST
π² 102 Β· Binary Tree Level Order Traversal
π² 199 Β· Binary Tree Right Side View
π² 1448 Β· Count Good Nodes in Binary Tree
π² 98 Β· Validate Binary Search Tree
π² 230 Β· Kth Smallest Element in BST
π² 105 Β· Construct Binary Tree from Preorder and Inorder
π² 208 Β· Implement Trie (Prefix Tree)
π² 211 Β· Design Add and Search Words Data Structure
π² 973 Β· K Closest Points to Origin
π² 215 Β· Kth Largest Element in an Array
π² 621 Β· Task Scheduler
π² 355 Β· Design Twitter
π² 46 Β· Permutations
π² 78 Β· Subsets
π² 39 Β· Combination Sum
π² 90 Β· Subsets II
π² 40 Β· Combination Sum II
π² 79 Β· Word Search
π² 131 Β· Palindrome Partitioning
π² 17 Β· Letter Combinations of a Phone Number
π² 200 Β· Number of Islands
π² 133 Β· Clone Graph
π² 695 Β· Max Area of Island
π² 417 Β· Pacific Atlantic Water Flow
π² 130 Β· Surrounded Regions
π² 994 Β· Rotting Oranges
π² 286 Β· Walls and Gates (Premium)
π² 207 Β· Course Schedule
π² 210 Β· Course Schedule II
π² 684 Β· Redundant Connection
π² 323 Β· Number of Connected Components (Premium)
π² 261 Β· Graph Valid Tree (Premium)
π² 1584 Β· Min Cost to Connect All Points
π² 743 Β· Network Delay Time
π² 787 Β· Cheapest Flights Within K Stops
π² 198 Β· House Robber
π² 213 Β· House Robber II
π² 5 Β· Longest Palindromic Substring
π² 647 Β· Palindromic Substrings
π² 91 Β· Decode Ways
π² 322 Β· Coin Change
π² 139 Β· Word Break
π² 300 Β· Longest Increasing Subsequence
π² 416 Β· Partition Equal Subset Sum
π² 62 Β· Unique Paths
π² 1143 Β· Longest Common Subsequence
π² 309 Β· Best Time to Buy & Sell Stock with Cooldown
π² 518 Β· Coin Change II
π² 494 Β· Target Sum
π² 97 Β· Interleaving String
π² 72 Β· Edit Distance
π² 53 Β· Maximum Subarray
π² 55 Β· Jump Game
π² 45 Β· Jump Game II
π² 134 Β· Gas Station
π² 846 Β· Hand of Straights
π² 1899 Β· Merge Triplets to Form Target Triplet
π² 763 Β· Partition Labels
π² 678 Β· Valid Parenthesis String
π² 57 Β· Insert Interval
π² 56 Β· Merge Intervals
π² 435 Β· Non-Overlapping Intervals
π² 253 Β· Meeting Rooms II (Premium)
π² 48 Β· Rotate Image
π² 54 Β· Spiral Matrix
π² 73 Β· Set Matrix Zeroes
π² 50 Β· Pow(x, n)
π² 43 Β· Multiply Strings
π² 2013 Β· Detect Squares
π² 371 Β· Sum of Two Integers
π² 7 Β· Reverse Integer
π² 42 Β· Trapping Rain Water
π² 76 Β· Minimum Window Substring
π² 239 Β· Sliding Window Maximum
π² 84 Β· Largest Rectangle in Histogram
π² 4 Β· Median of Two Sorted Arrays
π² 23 Β· Merge K Sorted Lists
π² 25 Β· Reverse Nodes in K-Group
π² 124 Β· Binary Tree Maximum Path Sum
π² 297 Β· Serialize and Deserialize Binary Tree
π² 212 Β· Word Search II
π² 295 Β· Find Median from Data Stream
π² 51 Β· N-Queens
π² 332 Β· Reconstruct Itinerary
π² 778 Β· Swim in Rising Water
π² 269 Β· Alien Dictionary (Premium)
π² 329 Β· Longest Increasing Path in a Matrix
π² 115 Β· Distinct Subsequences
π² 312 Β· Burst Balloons
π² 10 Β· Regular Expression Matching
π² 1851 Β· Minimum Interval to Include Each Query