Thanks to visit codestin.com
Credit goes to github.com

Skip to content

weiziii/LeetCode-in-Go

 
 

Repository files navigation

LeetCode 的 Go 解答

LeetCode 排名 codecov Build Status

进度

统计规则:1.免费题,2.算法题,3.能提交 Go 解答

Easy Medium Hard Total
Accepted 208 347 154 709
Total 220 371 163 754

题解

题号 题目 通过率 难度 收藏
976 * Largest Perimeter Triangle 56% Easy
975 * Odd Even Jump 49% Hard
974 * Subarray Sums Divisible by K 37% Medium
973 * K Closest Points to Origin 68% Easy
972 * Equal Rational Numbers 39% Hard
971 * Flip Binary Tree To Match Preorder Traversal 41% Medium
970 * Powerful Integers 38% Easy
969 * Pancake Sorting 62% Medium
968 * Binary Tree Cameras 32% Hard
967 * Numbers With Same Consecutive Differences 35% Medium
966 * Vowel Spellchecker 37% Medium
965 * Univalued Binary Tree 69% Easy
964 * Least Operators to Express Number 39% Hard
963 * Minimum Area Rectangle II 40% Medium
962 * Maximum Width Ramp 37% Medium
961 * N-Repeated Element in Size 2N Array 73% Easy
960 * Delete Columns to Make Sorted III 51% Hard
959 * Regions Cut By Slashes 62% Medium
958 * Check Completeness of a Binary Tree 45% Medium
957 * Prison Cells After N Days 36% Medium
956 * Tallest Billboard 35% Hard
955 * Delete Columns to Make Sorted II 30% Medium
954 * Array of Doubled Pairs 33% Medium
953 * Verifying an Alien Dictionary 57% Easy
952 * Largest Component Size by Common Factor 23% Hard
951 * Flip Equivalent Binary Trees 65% Medium
950 * Reveal Cards In Increasing Order 71% Medium
949 * Largest Time for Given Digits 32% Easy
948 * Bag of Tokens 38% Medium
947 * Most Stones Removed with Same Row or Column 52% Medium
946 * Validate Stack Sequences 57% Medium
945 * Minimum Increment to Make Array Unique 40% Medium
944 * Delete Columns to Make Sorted 70% Easy
943 * Find the Shortest Superstring 31% Hard
942 * DI String Match 69% Easy
941 * Valid Mountain Array 34% Easy
940 Distinct Subsequences II 36% Hard
939 * Minimum Area Rectangle 46% Medium
938 * Range Sum of BST 80% Medium
937 Reorder Log Files 57% Easy
936 * Stamping The Sequence 33% Hard
935 * Knight Dialer 35% Medium
934 * Shortest Bridge 42% Medium
933 * Number of Recent Calls 67% Easy
932 * Beautiful Array 49% Medium
931 * Minimum Falling Path Sum 56% Medium
930 Binary Subarrays With Sum 35% Medium
929 Unique Email Addresses 79% Easy
928 Minimize Malware Spread II 38% Hard
927 Three Equal Parts 28% Hard
926 Flip String to Monotone Increasing 46% Medium
925 Long Pressed Name 44% Easy
924 Minimize Malware Spread 37% Hard
923 3Sum With Multiplicity 30% Medium
922 Sort Array By Parity II 66% Easy
921 Minimum Add to Make Parentheses Valid 69% Medium
920 Number of Music Playlists 42% Hard
919 Complete Binary Tree Inserter 54% Medium
918 Maximum Sum Circular Subarray 27% Medium
917 Reverse Only Letters 56% Easy
916 Word Subsets 43% Medium
915 Partition Array into Disjoint Intervals 41% Medium
914 X of a Kind in a Deck of Cards 34% Easy
913 Cat and Mouse 25% Hard
911 Online Election 42% Medium
910 Smallest Range II 21% Medium
909 Snakes and Ladders 28% Medium
908 Smallest Range I 63% Easy
907 Sum of Subarray Minimums 23% Medium
906 Super Palindromes 29% Hard
905 Sort Array By Parity 71% Easy
904 Fruit Into Baskets 40% Medium
903 Valid Permutations for DI Sequence 40% Hard
902 Numbers At Most N Given Digit Set 27% Hard
901 Online Stock Span 44% Medium
900 RLE Iterator 47% Medium
899 Orderly Queue 45% Hard
898 Bitwise ORs of Subarrays 32% Medium
897 Increasing Order Search Tree 61% Easy
896 Monotonic Array 54% Easy
895 Maximum Frequency Stack 49% Hard
894 All Possible Full Binary Trees 68% Medium
893 Groups of Special-Equivalent Strings 61% Easy
892 Surface Area of 3D Shapes 55% Easy
891 Sum of Subsequence Widths 27% Hard
890 Find and Replace Pattern 69% Medium
889 Construct Binary Tree from Preorder and Postorder Traversal 57% Medium
888 Fair Candy Swap 54% Easy
887 Super Egg Drop 24% Hard
886 Possible Bipartition 39% Medium
885 Spiral Matrix III 63% Medium
884 Uncommon Words from Two Sentences 60% Easy
883 Projection Area of 3D Shapes 64% Easy
882 Reachable Nodes In Subdivided Graph 36% Hard
881 Boats to Save People 42% Medium
880 Decoded String at Index 22% Medium
879 Profitable Schemes 34% Hard
878 Nth Magical Number 24% Hard
877 Stone Game 60% Medium
876 Middle of the Linked List 63% Easy
875 Koko Eating Bananas 43% Medium
874 Walking Robot Simulation 30% Easy
873 Length of Longest Fibonacci Subsequence 43% Medium
872 Leaf-Similar Trees 61% Easy
871 Minimum Number of Refueling Stops 27% Hard
870 Advantage Shuffle 40% Medium
869 Reordered Power of 2 49% Medium
868 Binary Gap 59% Easy
867 Transpose Matrix 63% Easy
866 Prime Palindrome 18% Medium
865 Smallest Subtree with all the Deepest Nodes 53% Medium
864 Shortest Path to Get All Keys 34% Hard
863 All Nodes Distance K in Binary Tree 44% Medium
862 Shortest Subarray with Sum at Least K 21% Hard
861 Score After Flipping Matrix 68% Medium
860 Lemonade Change 50% Easy
859 Buddy Strings 27% Easy
858 Mirror Reflection 51% Medium
857 Minimum Cost to Hire K Workers 46% Hard
856 Score of Parentheses 54% Medium
855 Exam Room 36% Medium
854 K-Similar Strings 31% Hard
853 Car Fleet 37% Medium
852 Peak Index in a Mountain Array 68% Easy
851 Loud and Rich 45% Medium
850 Rectangle Area II 42% Hard
849 Maximize Distance to Closest Person 40% Easy
848 Shifting Letters 38% Medium
847 Shortest Path Visiting All Nodes 44% Hard
846 Hand of Straights 47% Medium
845 Longest Mountain in Array 33% Medium
844 Backspace String Compare 44% Easy
843 Guess the Word 41% Hard
842 Split Array into Fibonacci Sequence 34% Medium
841 Keys and Rooms 58% Medium
840 Magic Squares In Grid 35% Easy
839 Similar String Groups 33% Hard
838 Push Dominoes 42% Medium
837 New 21 Game 28% Medium
836 Rectangle Overlap 45% Easy
835 Image Overlap 49% Medium
834 Sum of Distances in Tree 36% Hard
833 Find And Replace in String 43% Medium
832 Flipping an Image 70% Easy
831 Masking Personal Information 41% Medium
830 Positions of Large Groups 47% Easy
829 Consecutive Numbers Sum 31% Hard
828 Unique Letter String 37% Hard
827 Making A Large Island 41% Hard
826 Most Profit Assigning Work 33% Medium
825 Friends Of Appropriate Ages 34% Medium
824 Goat Latin 56% Easy
823 Binary Trees With Factors 31% Medium
822 Card Flipping Game 39% Medium
821 Shortest Distance to a Character 62% Easy
820 Short Encoding of Words 45% Medium
819 Most Common Word 41% Easy
818 Race Car 33% Hard
817 Linked List Components 53% Medium
816 Ambiguous Coordinates 42% Medium
815 Bus Routes 38% Hard
814 Binary Tree Pruning 69% Medium
813 Largest Sum of Averages 43% Medium
812 Largest Triangle Area 54% Easy
811 Subdomain Visit Count 62% Easy
810 Chalkboard XOR Game 42% Hard
809 Expressive Words 41% Medium
808 Soup Servings 35% Medium
807 Max Increase to Keep City Skyline 80% Medium
806 Number of Lines To Write String 62% Easy
805 Split Array With Same Average 23% Hard
804 Unique Morse Code Words 73% Easy
803 Bricks Falling When Hit 26% Hard
802 Find Eventual Safe States 42% Medium
801 Minimum Swaps To Make Sequences Increasing 33% Medium
799 Champagne Tower 32% Medium
798 Smallest Rotation with Highest Score 37% Hard
797 All Paths From Source to Target 68% Medium
796 Rotate String 48% Easy
795 Number of Subarrays with Bounded Maximum 42% Medium
794 Valid Tic-Tac-Toe State 28% Medium
793 Preimage Size of Factorial Zeroes Function 39% Hard
792 Number of Matching Subsequences 40% Medium
791 Custom Sort String 60% Medium
790 Domino and Tromino Tiling 34% Medium
789 Escape The Ghosts 54% Medium
788 Rotated Digits 52% Easy
787 Cheapest Flights Within K Stops 33% Medium
786 K-th Smallest Prime Fraction 36% Hard
785 Is Graph Bipartite? 41% Medium
784 Letter Case Permutation 54% Easy
783 Minimum Distance Between BST Nodes 49% Easy
782 Transform to Chessboard 38% Hard
781 Rabbits in Forest 50% Medium
780 Reaching Points 26% Hard
779 K-th Symbol in Grammar 38% Medium
778 Swim in Rising Water 45% Hard
777 Swap Adjacent in LR String 32% Medium
775 Global and Local Inversions 37% Medium
773 Sliding Puzzle 49% Hard
771 Jewels and Stones 82% Easy
770 Basic Calculator IV 44% Hard
769 Max Chunks To Make Sorted 50% Medium
768 Max Chunks To Make Sorted II 44% Hard
767 Reorganize String 40% Medium
766 Toeplitz Matrix 60% Easy
765 Couples Holding Hands 50% Hard
764 Largest Plus Sign 42% Medium
763 Partition Labels 67% Medium
762 Prime Number of Set Bits in Binary Representation 57% Easy
761 Special Binary String 48% Hard
757 Set Intersection Size At Least Two 35% Hard
756 Pyramid Transition Matrix 49% Medium
754 Reach a Number 31% Easy
753 Cracking the Safe 44% Hard
752 Open the Lock 43% Medium
749 Contain Virus 40% Hard
748 Shortest Completing Word 53% Easy
747 Largest Number At Least Twice of Others 40% Easy
746 Min Cost Climbing Stairs 45% Easy
745 Prefix and Suffix Search 28% Hard
744 Find Smallest Letter Greater Than Target 43% Easy
743 Network Delay Time 38% Easy
741 Cherry Pickup 26% Hard
740 Delete and Earn 44% Medium
739 Daily Temperatures 57% Medium
738 Monotone Increasing Digits 41% Medium
736 Parse Lisp Expression 42% Hard
735 Asteroid Collision 37% Medium
733 Flood Fill 49% Easy
732 My Calendar III 52% Hard
731 My Calendar II 42% Medium
730 Count Different Palindromic Subsequences 37% Hard
729 My Calendar I 45% Medium
728 Self Dividing Numbers 68% Easy
726 Number of Atoms 43% Hard
725 Split Linked List in Parts 48% Medium
724 Find Pivot Index 40% Easy
722 Remove Comments 30% Medium
721 Accounts Merge 38% Medium
720 Longest Word in Dictionary 43% Easy
719 Find K-th Smallest Pair Distance 28% Hard
718 Maximum Length of Repeated Subarray 44% Medium
717 1-bit and 2-bit Characters 48% Easy
715 Range Module 33% Hard
714 Best Time to Buy and Sell Stock with Transaction Fee 49% Medium
713 Subarray Product Less Than K 35% Medium
712 Minimum ASCII Delete Sum for Two Strings 52% Medium
710 Random Pick with Blacklist 30% Hard
709 To Lower Case 75% Easy
707 Design Linked List 21% Easy
706 Design HashMap 52% Easy
705 Design HashSet 48% Easy
704 Binary Search 43% Easy
703 Kth Largest Element in a Stream 42% Easy
701 Insert into a Binary Search Tree 72% Medium
700 Search in a Binary Search Tree 65% Easy
699 Falling Squares 39% Hard
698 Partition to K Equal Sum Subsets 40% Medium
697 Degree of an Array 48% Easy
696 Count Binary Substrings 51% Easy
695 Max Area of Island 55% Medium
693 Binary Number with Alternating Bits 57% Easy
692 Top K Frequent Words 44% Medium
691 Stickers to Spell Word 36% Hard
689 Maximum Sum of 3 Non-Overlapping Subarrays 43% Hard
688 Knight Probability in Chessboard 42% Medium
687 Longest Univalue Path 33% Easy
686 Repeated String Match 31% Easy
685 Redundant Connection II 29% Hard
684 Redundant Connection 49% Medium
682 Baseball Game 59% Easy
680 Valid Palindrome II 33% Easy
679 24 Game 40% Hard
678 Valid Parenthesis String 31% Medium
677 Map Sum Pairs 51% Medium
676 Implement Magic Dictionary 50% Medium
675 Cut Off Trees for Golf Event 28% Hard
674 Longest Continuous Increasing Subsequence 43% Easy
673 Number of Longest Increasing Subsequence 32% Medium
672 Bulb Switcher II 49% Medium
671 Second Minimum Node In a Binary Tree 43% Easy
670 Maximum Swap 39% Medium
669 Trim a Binary Search Tree 59% Easy
668 Kth Smallest Number in Multiplication Table 40% Hard
667 Beautiful Arrangement II 51% Medium
665 Non-decreasing Array 19% Easy
664 Strange Printer 35% Hard
662 Maximum Width of Binary Tree 39% Medium
661 Image Smoother 47% Easy
659 Split Array into Consecutive Subsequences 39% Medium
658 Find K Closest Elements 36% Medium
657 Robot Return to Origin 70% Easy
655 Print Binary Tree 50% Medium
654 Maximum Binary Tree 71% Medium
653 Two Sum IV - Input is a BST 51% Easy
652 Find Duplicate Subtrees 43% Medium
650 2 Keys Keyboard 45% Medium
649 Dota2 Senate 36% Medium
648 Replace Words 49% Medium
647 Palindromic Substrings 55% Medium
646 Maximum Length of Pair Chain 47% Medium
645 Set Mismatch 40% Easy
643 Maximum Average Subarray I 38% Easy
641 Design Circular Deque 48% Medium
640 Solve the Equation 39% Medium
639 Decode Ways II 24% Hard
638 Shopping Offers 47% Medium
637 Average of Levels in Binary Tree 57% Easy
636 Exclusive Time of Functions 47% Medium
633 Sum of Square Numbers 32% Easy
632 Smallest Range 45% Hard
630 Course Schedule III 30% Hard
629 K Inverse Pairs Array 28% Hard
628 Maximum Product of Three Numbers 45% Easy
623 Add One Row to Tree 46% Medium
622 Design Circular Queue 38% Medium
621 Task Scheduler 43% Medium
617 Merge Two Binary Trees 68% Easy
611 Valid Triangle Number 43% Medium
609 Find Duplicate File in System 53% Medium
606 Construct String from Binary Tree 50% Easy
605 Can Place Flowers 30% Easy
600 Non-negative Integers without Consecutive Ones 32% Hard
599 Minimum Index Sum of Two Lists 46% Easy
598 Range Addition II 48% Easy
594 Longest Harmonious Subsequence 42% Easy
593 Valid Square 39% Medium
592 Fraction Addition and Subtraction 46% Medium
591 Tag Validator 31% Hard
587 Erect the Fence 34% Hard
583 Delete Operation for Two Strings 43% Medium
581 Shortest Unsorted Continuous Subarray 29% Easy
576 Out of Boundary Paths 31% Medium
575 Distribute Candies 58% Easy
572 Subtree of Another Tree 40% Easy
567 Permutation in String 37% Medium
566 Reshape the Matrix 58% Easy
565 Array Nesting 50% Medium
564 Find the Closest Palindrome 17% Hard
563 Binary Tree Tilt 46% Easy
561 Array Partition I 67% Easy
560 Subarray Sum Equals K 41% Medium
557 Reverse Words in a String III 62% Easy
556 Next Greater Element III 29% Medium
554 Brick Wall 47% Medium
553 Optimal Division 54% Medium
552 Student Attendance Record II 31% Hard
551 Student Attendance Record I 45% Easy
547 Friend Circles 52% Medium
546 Remove Boxes 37% Hard
543 Diameter of Binary Tree 45% Easy
542 01 Matrix 34% Medium
541 Reverse String II 44% Easy
540 Single Element in a Sorted Array 56% Medium
539 Minimum Time Difference 46% Medium
538 Convert BST to Greater Tree 49% Easy
537 Complex Number Multiplication 64% Medium
532 K-diff Pairs in an Array 28% Easy
530 Minimum Absolute Difference in BST 49% Easy
529 Minesweeper 51% Medium
528 Random Pick with Weight 42% Medium
526 Beautiful Arrangement 53% Medium
525 Contiguous Array 42% Medium
524 Longest Word in Dictionary through Deleting 44% Medium
523 Continuous Subarray Sum 23% Medium
522 Longest Uncommon Subsequence II 32% Medium
521 Longest Uncommon Subsequence I 55% Easy
520 Detect Capital 52% Easy
519 Random Flip Matrix 32% Medium
518 Coin Change 2 40% Medium
517 Super Washing Machines 36% Hard
516 Longest Palindromic Subsequence 44% Medium
515 Find Largest Value in Each Tree Row 56% Medium
514 Freedom Trail 39% Hard
513 Find Bottom Left Tree Value 57% Medium
509 * Fibonacci Number 66% Easy
508 Most Frequent Subtree Sum 53% Medium
507 Perfect Number 32% Easy
506 Relative Ranks 47% Easy
504 Base 7 44% Easy
503 Next Greater Element II 49% Medium
502 IPO 36% Hard
501 Find Mode in Binary Search Tree 38% Easy
500 Keyboard Row 61% Easy
498 Diagonal Traverse 44% Medium
497 Random Point in Non-overlapping Rectangles 34% Medium
496 Next Greater Element I 58% Easy
495 Teemo Attacking 51% Medium
494 Target Sum 44% Medium
493 Reverse Pairs 22% Hard
492 Construct the Rectangle 48% Easy
491 Increasing Subsequences 41% Medium
488 Zuma Game 37% Hard
486 Predict the Winner 46% Medium
485 Max Consecutive Ones 54% Easy
483 Smallest Good Base 33% Hard
482 License Key Formatting 39% Easy
481 Magical String 45% Medium
480 Sliding Window Median 30% Hard
479 Largest Palindrome Product 26% Easy
478 Generate Random Point in a Circle 35% Medium
477 Total Hamming Distance 48% Medium
476 Number Complement 61% Easy
475 Heaters 30% Easy
474 Ones and Zeroes 38% Medium
473 Matchsticks to Square 35% Medium
472 Concatenated Words 32% Hard
470 Implement Rand10() Using Rand7() 44% Medium
468 Validate IP Address 20% Medium
467 Unique Substrings in Wraparound String 33% Medium
466 Count The Repetitions 27% Hard
464 Can I Win 26% Medium
463 Island Perimeter 59% Easy
462 Minimum Moves to Equal Array Elements II 52% Medium
461 Hamming Distance 69% Easy
460 LFU Cache 27% Hard
459 Repeated Substring Pattern 39% Easy
458 Poor Pigs 44% Easy
457 Circular Array Loop 26% Medium
456 132 Pattern 27% Medium
455 Assign Cookies 47% Easy
454 4Sum II 49% Medium
453 Minimum Moves to Equal Array Elements 48% Easy
452 Minimum Number of Arrows to Burst Balloons 45% Medium
451 Sort Characters By Frequency 54% Medium
450 Delete Node in a BST 38% Medium
448 Find All Numbers Disappeared in an Array 52% Easy
447 Number of Boomerangs 48% Easy
446 Arithmetic Slices II - Subsequence 29% Hard
445 Add Two Numbers II 48% Medium
443 String Compression 36% Easy
442 Find All Duplicates in an Array 59% Medium
441 Arranging Coins 37% Easy
440 K-th Smallest in Lexicographical Order 25% Hard
438 Find All Anagrams in a String 35% Easy
437 Path Sum III 41% Easy
436 Find Right Interval 42% Medium
435 Non-overlapping Intervals 41% Medium
434 Number of Segments in a String 36% Easy
433 Minimum Genetic Mutation 36% Medium
432 All O`one Data Structure 28% Hard
424 Longest Repeating Character Replacement 43% Medium
423 Reconstruct Original Digits from English 45% Medium
421 Maximum XOR of Two Numbers in an Array 49% Medium
420 Strong Password Checker 18% Hard
419 Battleships in a Board 64% Medium
417 Pacific Atlantic Water Flow 36% Medium
416 Partition Equal Subset Sum 39% Medium
415 Add Strings 42% Easy
414 Third Maximum Number 28% Easy
413 Arithmetic Slices 54% Medium
412 Fizz Buzz 58% Easy
410 Split Array Largest Sum 41% Hard
409 Longest Palindrome 47% Easy
407 Trapping Rain Water II 38% Hard
406 Queue Reconstruction by Height 58% Medium
405 Convert a Number to Hexadecimal 41% Easy
404 Sum of Left Leaves 48% Easy
403 Frog Jump 34% Hard
402 Remove K Digits 25% Medium
401 Binary Watch 44% Easy
400 Nth Digit 30% Easy
399 Evaluate Division 45% Medium
398 Random Pick Index 48% Medium
397 Integer Replacement 30% Medium
396 Rotate Function 34% Medium
395 Longest Substring with At Least K Repeating Characters 37% Medium
394 Decode String 43% Medium
393 UTF-8 Validation 35% Medium
392 Is Subsequence 45% Medium
391 Perfect Rectangle 27% Hard
390 Elimination Game 43% Medium
389 Find the Difference 52% Easy
388 Longest Absolute File Path 38% Medium
387 First Unique Character in a String 48% Easy
385 Mini Parser 31% Medium
384 Shuffle an Array 49% Medium
383 Ransom Note 49% Easy
382 Linked List Random Node 48% Medium
381 Insert Delete GetRandom O(1) - Duplicates allowed 31% Hard
380 Insert Delete GetRandom O(1) 41% Medium
378 Kth Smallest Element in a Sorted Matrix 47% Medium
377 Combination Sum IV 43% Medium
376 Wiggle Subsequence 36% Medium
375 Guess Number Higher or Lower II 37% Medium
373 Find K Pairs with Smallest Sums 32% Medium
372 Super Pow 35% Medium
371 Sum of Two Integers 51% Easy
368 Largest Divisible Subset 34% Medium
367 Valid Perfect Square 39% Easy
365 Water and Jug Problem 28% Medium
363 Max Sum of Rectangle No Larger Than K 34% Hard
357 Count Numbers with Unique Digits 46% Medium
355 Design Twitter 26% Medium
354 Russian Doll Envelopes 33% Hard
352 Data Stream as Disjoint Intervals 42% Hard
350 Intersection of Two Arrays II 46% Easy
349 Intersection of Two Arrays 52% Easy
347 Top K Frequent Elements 52% Medium
345 Reverse Vowels of a String 40% Easy
344 Reverse String 62% Easy
343 Integer Break 47% Medium
342 Power of Four 39% Easy
338 Counting Bits 63% Medium
337 House Robber III 46% Medium
336 Palindrome Pairs 29% Hard
335 Self Crossing 26% Hard
334 Increasing Triplet Subsequence 39% Medium
332 Reconstruct Itinerary 30% Medium
331 Verify Preorder Serialization of a Binary Tree 37% Medium
330 Patching Array 33% Hard
329 Longest Increasing Path in a Matrix 38% Hard
328 Odd Even Linked List 47% Medium
327 Count of Range Sum 31% Hard
326 Power of Three 41% Easy
324 Wiggle Sort II 27% Medium
322 Coin Change 28% Medium
321 Create Maximum Number 25% Hard
319 Bulb Switcher 43% Medium
318 Maximum Product of Word Lengths 47% Medium
316 Remove Duplicate Letters 31% Hard
315 Count of Smaller Numbers After Self 36% Hard
313 Super Ugly Number 40% Medium
312 Burst Balloons 45% Hard
310 Minimum Height Trees 29% Medium
309 Best Time to Buy and Sell Stock with Cooldown 43% Medium
307 Range Sum Query - Mutable 26% Medium
306 Additive Number 28% Medium
304 Range Sum Query 2D - Immutable 30% Medium
303 Range Sum Query - Immutable 35% Easy
301 Remove Invalid Parentheses 37% Hard
300 Longest Increasing Subsequence 39% Medium
299 Bulls and Cows 38% Medium
295 Find Median from Data Stream 33% Hard
292 Nim Game 55% Easy
290 Word Pattern 34% Easy
289 Game of Life 42% Medium
287 Find the Duplicate Number 47% Medium
283 Move Zeroes 53% Easy
282 Expression Add Operators 31% Hard
279 Perfect Squares 39% Medium
275 H-Index II 35% Medium
274 H-Index 34% Medium
273 Integer to English Words 23% Hard
268 Missing Number 47% Easy
264 Ugly Number II 35% Medium
263 Ugly Number 40% Easy
260 Single Number III 55% Medium
258 Add Digits 53% Easy
257 Binary Tree Paths 44% Easy
242 Valid Anagram 50% Easy
241 Different Ways to Add Parentheses 48% Medium
240 Search a 2D Matrix II 39% Medium
239 Sliding Window Maximum 36% Hard
238 Product of Array Except Self 53% Medium
234 Palindrome Linked List 34% Easy
233 Number of Digit One 29% Hard
232 Implement Queue using Stacks 41% Easy
231 Power of Two 41% Easy
230 Kth Smallest Element in a BST 49% Medium
229 Majority Element II 30% Medium
228 Summary Ranges 34% Medium
227 Basic Calculator II 32% Medium
226 Invert Binary Tree 56% Easy
225 Implement Stack using Queues 37% Easy
224 Basic Calculator 31% Hard
223 Rectangle Area 35% Medium
221 Maximal Square 31% Medium
220 Contains Duplicate III 19% Medium
219 Contains Duplicate II 34% Easy
218 The Skyline Problem 30% Hard
217 Contains Duplicate 50% Easy
216 Combination Sum III 49% Medium
215 Kth Largest Element in an Array 45% Medium
214 Shortest Palindrome 26% Hard
213 House Robber II 34% Medium
212 Word Search II 27% Hard
211 Add and Search Word - Data structure design 28% Medium
210 Course Schedule II 33% Medium
209 Minimum Size Subarray Sum 33% Medium
208 Implement Trie (Prefix Tree) 35% Medium
207 Course Schedule 36% Medium
206 Reverse Linked List 51% Easy
205 Isomorphic Strings 36% Easy
204 Count Primes 27% Easy
203 Remove Linked List Elements 34% Easy
202 Happy Number 43% Easy
201 Bitwise AND of Numbers Range 35% Medium
200 Number of Islands 39% Medium
199 Binary Tree Right Side View 45% Medium
198 House Robber 40% Easy
189 Rotate Array 28% Easy
188 Best Time to Buy and Sell Stock IV 25% Hard
187 Repeated DNA Sequences 34% Medium
179 Largest Number 24% Medium
174 Dungeon Game 26% Hard
172 Factorial Trailing Zeroes 37% Easy
171 Excel Sheet Column Number 50% Easy
169 Majority Element 50% Easy
168 Excel Sheet Column Title 28% Easy
167 Two Sum II - Input array is sorted 48% Easy
166 Fraction to Recurring Decimal 18% Medium
165 Compare Version Numbers 22% Medium
164 Maximum Gap 31% Hard
162 Find Peak Element 40% Medium
155 Min Stack 34% Easy
154 Find Minimum in Rotated Sorted Array II 38% Hard
153 Find Minimum in Rotated Sorted Array 42% Medium
152 Maximum Product Subarray 28% Medium
150 Evaluate Reverse Polish Notation 30% Medium
149 Max Points on a Line 15% Hard
148 Sort List 33% Medium
147 Insertion Sort List 35% Medium
146 LRU Cache 23% Hard
145 Binary Tree Postorder Traversal 46% Hard
144 Binary Tree Preorder Traversal 49% Medium
143 Reorder List 29% Medium
140 Word Break II 26% Hard
139 Word Break 33% Medium
137 Single Number II 44% Medium
136 Single Number 58% Easy
135 Candy 27% Hard
134 Gas Station 32% Medium
132 Palindrome Partitioning II 26% Hard
131 Palindrome Partitioning 38% Medium
130 Surrounded Regions 21% Medium
129 Sum Root to Leaf Numbers 40% Medium
128 Longest Consecutive Sequence 40% Hard
127 Word Ladder 22% Medium
126 Word Ladder II 16% Hard
125 Valid Palindrome 29% Easy
124 Binary Tree Maximum Path Sum 28% Hard
123 Best Time to Buy and Sell Stock III 32% Hard
122 Best Time to Buy and Sell Stock II 50% Easy
121 Best Time to Buy and Sell Stock 45% Easy
120 Triangle 37% Medium
119 Pascal's Triangle II 41% Easy
118 Pascal's Triangle 43% Easy
115 Distinct Subsequences 34% Hard
114 Flatten Binary Tree to Linked List 40% Medium
113 Path Sum II 38% Medium
112 Path Sum 36% Easy
111 Minimum Depth of Binary Tree 34% Easy
110 Balanced Binary Tree 40% Easy
109 Convert Sorted List to Binary Search Tree 38% Medium
108 Convert Sorted Array to Binary Search Tree 48% Easy
107 Binary Tree Level Order Traversal II 45% Easy
106 Construct Binary Tree from Inorder and Postorder Traversal 37% Medium
105 Construct Binary Tree from Preorder and Inorder Traversal 38% Medium
104 Maximum Depth of Binary Tree 58% Easy
103 Binary Tree Zigzag Level Order Traversal 39% Medium
102 Binary Tree Level Order Traversal 46% Medium
101 Symmetric Tree 42% Easy
100 Same Tree 49% Easy
99 Recover Binary Search Tree 33% Hard
98 Validate Binary Search Tree 25% Medium
97 Interleaving String 26% Hard
96 Unique Binary Search Trees 44% Medium
95 Unique Binary Search Trees II 34% Medium
94 Binary Tree Inorder Traversal 54% Medium
93 Restore IP Addresses 30% Medium
92 Reverse Linked List II 33% Medium
91 Decode Ways 21% Medium
90 Subsets II 40% Medium
89 Gray Code 44% Medium
88 Merge Sorted Array 34% Easy
87 Scramble String 30% Hard
86 Partition List 35% Medium
85 Maximal Rectangle 31% Hard
84 Largest Rectangle in Histogram 29% Hard
83 Remove Duplicates from Sorted List 41% Easy
82 Remove Duplicates from Sorted List II 31% Medium
81 Search in Rotated Sorted Array II 32% Medium
80 Remove Duplicates from Sorted Array II 39% Medium
79 Word Search 29% Medium
78 Subsets 49% Medium
77 Combinations 45% Medium
76 Minimum Window Substring 29% Hard
75 Sort Colors 40% Medium
74 Search a 2D Matrix 34% Medium
73 Set Matrix Zeroes 38% Medium
72 Edit Distance 35% Hard
71 Simplify Path 27% Medium
70 Climbing Stairs 42% Easy
69 Sqrt(x) 30% Easy
68 Text Justification 22% Hard
67 Add Binary 37% Easy
66 Plus One 40% Easy
65 Valid Number 13% Hard
64 Minimum Path Sum 44% Medium
63 Unique Paths II 33% Medium
62 Unique Paths 45% Medium
61 Rotate List 26% Medium
60 Permutation Sequence 31% Medium
59 Spiral Matrix II 44% Medium
58 Length of Last Word 32% Easy
57 Insert Interval 30% Hard
56 Merge Intervals 34% Medium
55 Jump Game 30% Medium
54 Spiral Matrix 29% Medium
53 Maximum Subarray 42% Easy
52 N-Queens II 50% Hard
51 N-Queens 36% Hard
50 Pow(x, n) 27% Medium
49 Group Anagrams 43% Medium
48 Rotate Image 45% Medium
47 Permutations II 38% Medium
46 Permutations 52% Medium
45 Jump Game II 26% Hard
44 Wildcard Matching 22% Hard
43 Multiply Strings 29% Medium
42 Trapping Rain Water 41% Hard
41 First Missing Positive 27% Hard
40 Combination Sum II 39% Medium
39 Combination Sum 45% Medium
38 Count and Say 38% Easy
37 Sudoku Solver 34% Hard
36 Valid Sudoku 41% Medium
35 Search Insert Position 40% Easy
34 Find First and Last Position of Element in Sorted Array 32% Medium
33 Search in Rotated Sorted Array 32% Medium
32 Longest Valid Parentheses 24% Hard
31 Next Permutation 29% Medium
30 Substring with Concatenation of All Words 22% Hard
29 Divide Two Integers 15% Medium
28 Implement strStr() 30% Easy
27 Remove Element 43% Easy
26 Remove Duplicates from Sorted Array 39% Easy
25 Reverse Nodes in k-Group 34% Hard
24 Swap Nodes in Pairs 42% Medium
23 Merge k Sorted Lists 32% Hard
22 Generate Parentheses 52% Medium
21 Merge Two Sorted Lists 45% Easy
20 Valid Parentheses 35% Easy
19 Remove Nth Node From End of List 33% Medium
18 4Sum 29% Medium
17 Letter Combinations of a Phone Number 39% Medium
16 3Sum Closest 33% Medium
15 3Sum 22% Medium
14 Longest Common Prefix 32% Easy
13 Roman to Integer 51% Easy
12 Integer to Roman 49% Medium
11 Container With Most Water 41% Medium
10 Regular Expression Matching 24% Hard
9 Palindrome Number 41% Easy
8 String to Integer (atoi) 14% Medium
7 Reverse Integer 24% Easy
6 ZigZag Conversion 30% Medium
5 Longest Palindromic Substring 26% Medium
4 Median of Two Sorted Arrays 25% Hard
3 Longest Substring Without Repeating Characters 25% Medium
2 Add Two Numbers 30% Medium
1 Two Sum 39% Easy

以下免费的算法题,暂时不能提交 Go 解答

helper

helper 会处理大部分琐碎的工作。

notes

notes 记录了我答题过程中,对知识点的总结。

kit

针对 LeetCode 中经常出现的以下数据结构,在 kit 中进行了定义,并添加了与 []int 相互转换的函数。利用 Go 1.9 添加的 type alias 功能,易于添加单元测试。

About

🎓 Go Solution for LeetCode algorithm problems, 100% coverage, continually updating.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%