Important Notes: I would not write coding in Visual Studio, so you can visit solutions by two methonds. One is by my Blog Column, and another direct way is by questions index.
Algorithm is tool for exercising our thinking patterns, and we can strengthen the ability to convert mathematical models into code. Whether you are engaged in artificial intelligence, in-depth learning, or advanced software development, no matter what language you use, such as C#,C++,Java,python,etc., and applying the most appropriate algorithm is always the most important point when faced with a specific problem. Every problem in practice has its own particularity, which makes it not that easier to choose the most appropriate algorithm. How do we write the algorithm that most efficiently apply to a practical issue? Yes, LeetCode. You can write an algorithm until it accepted, and do not rush to do the next question, and learn the solution someone else has submitted, so you can solve the problem from the ability of solving the problem to that fast and efficient realm
.
I create this respository called leetcode-csharp because I apply C# language to solve LeetCode and every day
will update it and also publish it in CSDN blog
(http://blog.csdn.net/daigualu) my blog column(http://blog.csdn.net/column/details/14761.html) Also, I will put some algorithm ideas that famous scientists have created on My Wiki for this repository such as Flody tortoise and hare and KMP and so on.
Anyway, welcome to view, star and fork, then contribute.
solutions using C# for leetcode according to tags of questions
- Solution Array Details
- Solution BinarySearch Details
- Solution DynamicProgramming Details
- Solution HashTable Details
- Solution LinkedList Details
- Solution Math Details
- Solution Stack Details
- Solution String Details
- Solution Tree Details
- Solution TwoPointers Details
- Solution BitManipulation
- Solution Sort
- Fork it!
- Create your feature branch: git checkout -b my-leetcode-csharp
- Commit your changes: git commit -am 'Add some questions and better solutions'
- Push to the branch: git push origin my-leetcode-csharp
- Submit a pull request and enjoy! :D
ID | Blog address |
---|---|
35 | Search Insert Position |
118 | Pascal's Triangle |
119 | Pascal's Triangle II |
414 | Third Maximum Number |
121 | Best Time to Buy and Sell Stock |
66 | Plus One |
26 | Remove Duplicates from Sorted Array |
27 | Remove Element |
122 | Best Time to Buy and Sell Stock II |
268 | Missing Number |
217 | Contains Duplicate |
532 | K-diff Pairs in an Array |
189 | Rotate Array |
169 | Majority Element |
167 | Two Sum II - Input array is sorted |
88 | Merge Sorted Array |
53 | Maximum Subarray |
485 | Max Consecutive Ones |
283 | Move Zeroes |
448 | Find All Numbers Disappeared in an Array |
1 | Two Sum |
219 | Contains Duplicate II |
566 | Reshape the Matrix |
561 | Array Partition I |
ID | Blog address | PassRate | Level |
---|---|---|---|
367 | Valid Perfect Square | 37.8% | Easy |
270 | Closest Binary Search Tree Value | 38.8% | Easy |
167 | Two Sum II - Input array is sorted | 47.4% | Easy |
441 | Arranging Coins | 36.0% | Easy |
35 | Search Insert Position | 39.3% | Easy |
374 | Guess Number Higher or Lower | 34.4% | Easy |
69 | Sqrt(x) | 27.4% | Easy |
278 | First Bad Version | 24.8% | Easy |
475 | Heaters | 29.7% | Easy |
350 | Intersection of Two Arrays II | 44.1% | Easy |
349 | Intersection of Two Arrays | 46.5% | Easy |
ID | Blog address | PassRate | Level |
---|---|---|---|
53 | Maximum Subarray | 39.2% | Easy |
169 | Majority Element | 45.6% | Easy |
303 | Range Sum Query - Immutable | 27.8% | Easy |
276 | Paint Fence | 34.1% | Easy |
523 | Continuous Subarray Sum | 21.6% | Easy |
256 | Paint House | 45.9% | Easy |
198 | House Robber | 38.1% | Easy |
121 | Best Time to Buy and Sell Stock | 40.1% | Easy |
70 | Climbing Stairs | 39.2% | Easy |
ID | Blog address |
---|---|
136 | Single number |
1 | Two Sum |
447 | Number of Boomerangs |
463 | Island Perimeter |
409 | Longest Palindrome |
438 | Find All Anagrams in a String |
389 | Find the Difference |
350 | Intersection of Two Arrays II |
349 | Intersection of Two Arrays |
500 | Keyboard Row |
217 | Contains Duplicate |
204 | Count Primes |
202 | Happy Number |
219 | Contains Duplicate II |
242 | Valid Anagram |
290 | Word Pattern |
205 | Isomorphic Strings |
ID | Blog address |
---|---|
141 | Linked List Cycle |
237 | Delete Node in a Linked List |
83 | Remove Duplicates from Sorted List |
160 | Intersection of Two Linked Lists |
203 | Remove Linked List Elements |
206 | Reverse Linked List |
234 | Palindrome Linked List |
21 | Merge Two Sorted Lists |
ID | Blog address |
---|---|
231 | Power of Two |
268 | Missing Number |
507 | Perfect Number |
9 | Palindrome Number |
453 | Minimum Moves to Equal Array Elements |
13 | Roman to Integer |
441 | Arranging Coins |
415 | Add Strings |
400 | Nth Digit |
367 | Valid Perfect Square |
66 | Plus One |
7 | Reverse Integer |
204 | Count Primes |
202 | Happy Number |
172 | Factorial Trailing Zeroes |
171 | Excel Sheet Column Number |
168 | Excel Sheet Column Title |
258 | Add Digits |
263 | Ugly Number |
69 | Sqrt(x) |
67 | Add Binary |
246 | Strobogrammatic Number |
326 | Power of Three |
ID | Blog address | PassRate | Level |
---|---|---|---|
225 | Implement Stack using Queues | 32.0% | Easy |
496 | Next Greater Element I | 57.5% | Easy |
155 | Min Stack | 27.4% | Easy |
232 | Implement Queue using Stacks | 35.8% | Easy |
20 | Valid Parentheses | 32.9% | Easy |
ID | Blog address | PassRate | Level |
---|---|---|---|
58 | Length of Last Word | 31.5% | Easy |
20 | Valid Parentheses | 32.8% | Easy |
520 | Detect Capital | 52.5% | Easy |
459 | Repeated Substring Pattern | 38.4% | Easy |
434 | Number of Segments in a String | 37.0% | Easy |
408 | Valid Word Abbreviation | 27.5% | Easy |
13 | Roman to Integer | 44.6% | Easy |
14 | Longest Common Prefix | 31.0% | Easy |
383 | Ransom Note | 46.5% | Easy |
521 | Longest Uncommon Subsequence I | 46.1% | Easy |
345 | Reverse Vowels of a String | 37.9% | Easy |
28 | Implement strStr() | 27.5% | Easy |
344 | Reverse String | 58.2% | Easy |
293 | Flip Game | 54.8% | Easy |
38 | Count and Say | 33.4% | Easy |
157 | Read N Characters Given Read4 | 29.2% | Easy |
541 | Reverse String II | 44.1% | Easy |
125 | Valid Palindrome | 25.8% | Easy |
67 | Add Binary | 31.3% | Easy |
ID | Blog address | PassRate | Level |
---|---|---|---|
107 | Binary Tree Level Order Traversal II | 39.0% | Easy |
257 | Binary Tree Paths | 36.8% | Easy |
501 | Find Mode in Binary Search Tree | 38.4% | Easy |
437 | Path Sum III | 39.3% | Easy |
404 | Sum of Left Leaves | 46.5% | Easy |
112 | Path Sum | 33.5% | Easy |
110 | Balanced Binary Tree | 36.8% | Easy |
108 | Convert Sorted Array to Binary Search Tree | 41.3% | Easy |
543 | Diameter of Binary Tree | 42.3% | Easy |
226 | Invert Binary Tree | 50.8% | Easy |
235 | Lowest Common Ancestor of a Binary Search Tree | 38.5% | Easy |
104 | Maximum Depth of Binary Tree | 51.7% | Easy |
111 | Minimum Depth of Binary Tree | 32.7% | Easy |
101 | Symmetric Tree | 37.9% | Easy |
100 | Same Tree | 45.8% | Easy |
ID | Blog address |
---|---|
345 | Reverse Vowels of a String |
125 | Valid Palindrome |
283 | Move Zeroes |
88 | Merge Sorted Array |
234 | Palindrome Linked List |
349 | Intersection of Two Arrays |
167 | Two Sum II - Input array is sorted |
350 | Intersection of Two Arrays II |
344 | Reverse String |
28 | Implement strStr() |
27 | Remove Element |
26 | Remove Duplicates from Sorted Array |
141 | Linked List Cycle |
532 | K-diff Pairs in an Array |