Back to articles
I Solved 800+ LeetCode Problems in C# - Here's What I Built

I Solved 800+ LeetCode Problems in C# - Here's What I Built

via Dev.toSivalingam

What's on the site Every solution page has: ✅ Clean, readable C# code with syntax highlighting 📝 The approach explained in plain English ⏱️ Time and space complexity 🔗 Direct link to the LeetCode problem You can browse by topic (Dynamic Programming, Trees, Graphs, Sliding Window, Two Pointers, and 40+ more) or filter by difficulty (Easy / Medium / Hard). Example — Two Sum Here's what a typical solution looks like: // Approach: Use a dictionary to store each number's index. // For each number, check if its complement (target - num) already exists. // Time: O(n) Space: O(n) public class Solution { public int [] TwoSum ( int [] nums , int target ) { var map = new Dictionary < int , int >(); for ( int i = 0 ; i < nums . Length ; i ++) { int complement = target - nums [ i ]; if ( map . ContainsKey ( complement )) return new int [] { map [ complement ], i }; map [ nums [ i ]] = i ; } return Array . Empty < int >(); } } Every solution follows this pattern — the comment at the top explains the

Continue reading on Dev.to

Opens in a new tab

Read Full Article
6 views

Related Articles