Skip to content

Go Solution for LeetCode algorithms problems, 100% coverage.

License

Notifications You must be signed in to change notification settings

jonyig/LeetCode-in-Go

 
 

Repository files navigation

LeetCode 的 Go 解答

LeetCode 排名 codecov Build Status Go

进度

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

Easy Medium Hard Total
Accepted 265 456 187 908
Total 267 472 197 936

题解

题号 题目 通过率 难度 收藏
1250 * Check If It Is a Good Array 46% Hard
1249 * Minimum Remove to Make Valid Parentheses 55% Medium
1248 * Count Number of Nice Subarrays 50% Medium
1247 * Minimum Swaps to Make Strings Equal 56% Medium
1240 * Tiling a Rectangle with the Fewest Squares 48% Hard
1239 * Maximum Length of a Concatenated String with Unique Characters 40% Medium
1238 * Circular Permutation in Binary Representation 57% Medium
1237 * Find Positive Integer Solution for a Given Equation 65% Easy
1235 * Maximum Profit in Job Scheduling 44% Hard
1234 * Replace the Substring for Balanced String 29% Medium
1233 * Remove Sub-Folders from the Filesystem 53% Medium
1232 * Check If It Is a Straight Line 47% Easy
1227 * Airplane Seat Assignment Probability 61% Medium
1224 * Maximum Equal Frequency 31% Hard
1223 * Dice Roll Simulation 42% Medium
1222 * Queens That Can Attack the King 68% Medium
1221 Split a String in Balanced Strings 78% Easy
1220 * Count Vowels Permutation 51% Hard
1219 * Path with Maximum Gold 61% Medium
1218 * Longest Arithmetic Subsequence of Given Difference 38% Medium
1217 Play with Chips 63% Easy
1210 * Minimum Moves to Reach Target with Rotations 43% Hard
1209 * Remove All Adjacent Duplicates in String II 57% Medium
1208 * Get Equal Substrings Within Budget 36% Medium
1207 Unique Number of Occurrences 72% Easy
1206 * Design Skiplist 60% Hard
1203 * Sort Items by Groups Respecting Dependencies 45% Hard
1202 Smallest String With Swaps 41% Medium
1201 * Ugly Number III 24% Medium
1200 Minimum Absolute Difference 66% Easy
1192 * Critical Connections in a Network 47% Hard
1191 * K-Concatenation Maximum Sum 24% Medium
1190 Reverse Substrings Between Each Pair of Parentheses 57% Medium
1189 Maximum Number of Balloons 61% Easy
1187 * Make Array Strictly Increasing 40% Hard
1186 Maximum Subarray Sum with One Deletion 33% Medium
1185 Day of the Week 64% Easy
1184 Distance Between Bus Stops 56% Easy
1178 Number of Valid Words for Each Puzzle 35% Hard
1177 Can Make Palindrome from Substring 32% Medium
1175 Prime Arrangements 50% Easy
1172 Dinner Plate Stacks 40% Hard
1171 Remove Zero Sum Consecutive Nodes from Linked List 41% Medium
1170 Compare Strings by Frequency of the Smallest Character 58% Easy
1169 Invalid Transactions 28% Medium
1163 Last Substring in Lexicographical Order 30% Hard
1162 As Far from Land as Possible 40% Medium
1161 Maximum Level Sum of a Binary Tree 70% Medium
1160 Find Words That Can Be Formed by Characters 66% Easy
1157 Online Majority Element In Subarray 33% Hard
1156 Swap For Longest Repeated Character Substring 46% Medium
1155 Number of Dice Rolls With Target Sum 48% Medium
1154 Day of the Year 48% Easy
1147 Longest Chunked Palindrome Decomposition 58% Hard
1146 Snapshot Array 34% Medium
1145 Binary Tree Coloring Game 49% Medium
1144 Decrease Elements To Make Array Zigzag 43% Medium
1143 Longest Common Subsequence 57% Medium
1140 Stone Game II 60% Medium
1139 Largest 1-Bordered Square 44% Medium
1138 Alphabet Board Path 44% Medium
1137 N-th Tribonacci Number 57% Easy
1131 Maximum of Absolute Value Expression 52% Medium
1130 Minimum Cost Tree From Leaf Values 62% Medium
1129 Shortest Path with Alternating Colors 37% Medium
1128 Number of Equivalent Domino Pairs 46% Easy
1125 Smallest Sufficient Team 44% Hard
1124 Longest Well-Performing Interval 31% Medium
1123 Lowest Common Ancestor of Deepest Leaves 64% Medium
1122 Relative Sort Array 66% Easy
1111 Maximum Nesting Depth of Two Valid Parentheses Strings 67% Medium
1110 Delete Nodes And Return Forest 64% Medium
1109 Corporate Flight Bookings 49% Medium
1108 Defanging an IP Address 84% Easy
1106 Parsing A Boolean Expression 57% Hard
1105 Filling Bookcase Shelves 56% Medium
1104 Path In Zigzag Labelled Binary Tree 70% Medium
1103 Distribute Candies to People 59% Easy
1096 Brace Expansion II 59% Hard
1095 Find in Mountain Array 34% Hard
1094 Car Pooling 57% Medium
1093 Statistics from a Large Sample 44% Medium
1092 Shortest Common Supersequence 49% Hard
1091 Shortest Path in Binary Matrix 36% Medium
1090 Largest Values From Labels 57% Medium
1089 Duplicate Zeros 58% Easy
1081 Smallest Subsequence of Distinct Characters 44% Medium
1080 Insufficient Nodes in Root to Leaf Paths 45% Medium
1079 Letter Tile Possibilities 74% Medium
1078 Occurrences After Bigram 64% Easy
1074 Number of Submatrices That Sum to Target 58% Hard
1073 Adding Two Negabinary Numbers 32% Medium
1072 Flip Columns For Maximum Number of Equal Rows 59% Medium
1071 Greatest Common Divisor of Strings 53% Easy
1054 Distant Barcodes 40% Medium
1053 Previous Permutation With One Swap 46% Medium
1052 Grumpy Bookstore Owner 53% Medium
1051 Height Checker 68% Easy
1049 Last Stone Weight II 41% Medium
1048 Longest String Chain 51% Medium
1047 Remove All Adjacent Duplicates In String 65% Easy
1046 Last Stone Weight 62% Easy
1044 Longest Duplicate Substring 23% Hard
1043 Partition Array for Maximum Sum 62% Medium
1042 Flower Planting With No Adjacent 47% Easy
1041 Robot Bounded In Circle 46% Medium
1040 Moving Stones Until Consecutive II 49% Medium
1039 Minimum Score Triangulation of Polygon 44% Medium
1038 Binary Search Tree to Greater Sum Tree 77% Medium
1037 Valid Boomerang 37% Easy
1036 Escape a Large Maze 34% Hard
1035 Uncrossed Lines 52% Medium
1034 Coloring A Border 43% Medium
1033 Moving Stones Until Consecutive 38% Easy
1032 Stream of Characters 45% Hard
1031 Maximum Sum of Two Non-Overlapping Subarrays 55% Medium
1030 Matrix Cells in Distance Order 64% Easy
1029 Two City Scheduling 55% Easy
1028 Recover a Tree From Preorder Traversal 69% Hard
1027 Longest Arithmetic Sequence 51% Medium
1026 Maximum Difference Between Node and Ancestor 61% Medium
1025 Divisor Game 65% Easy
1024 Video Stitching 47% Medium
1023 Camelcase Matching 54% Medium
1022 Sum of Root To Leaf Binary Numbers 61% Easy
1021 Remove Outermost Parentheses 75% Easy
1020 Number of Enclaves 54% Medium
1019 Next Greater Node In Linked List 56% Medium
1018 Binary Prefix Divisible By 5 46% Easy
1017 Convert to Base -2 57% Medium
1016 Binary String With Substrings Representing 1 To N 58% Medium
1015 Smallest Integer Divisible by K 30% Medium
1014 Best Sightseeing Pair 51% Medium
1013 Partition Array Into Three Parts With Equal Sum 56% Easy
1012 Numbers With Repeated Digits 35% Hard
1011 Capacity To Ship Packages Within D Days 55% Medium
1010 Pairs of Songs With Total Durations Divisible by 60 46% Easy
1009 Complement of Base 10 Integer 59% Easy
1008 Construct Binary Search Tree from Preorder Traversal 73% Medium
1007 Minimum Domino Rotations For Equal Row 51% Medium
1006 Clumsy Factorial 53% Medium
1005 Maximize Sum Of Array After K Negations 50% Easy
1004 Max Consecutive Ones III 55% Medium
1003 Check If Word Is Valid After Substitutions 53% Medium
1002 Find Common Characters 65% Easy
1001 Grid Illumination 34% Hard
1000 Minimum Cost to Merge Stones 36% Hard
0999 Available Captures for Rook 65% Easy
0998 Maximum Binary Tree II 61% Medium
0997 Find the Town Judge 49% Easy
0996 Number of Squareful Arrays 47% Hard
0995 Minimum Number of K Consecutive Bit Flips 46% Hard
0994 Rotting Oranges 46% Easy
0993 Cousins in Binary Tree 51% Easy
0992 Subarrays with K Different Integers 45% Hard
0991 Broken Calculator 42% Medium
0990 Satisfiability of Equality Equations 41% Medium
0989 Add to Array-Form of Integer 43% Easy
0988 Smallest String Starting From Leaf 44% Medium
0987 Vertical Order Traversal of a Binary Tree 33% Medium
0986 Interval List Intersections 64% Medium
0985 Sum of Even Numbers After Queries 62% Easy
0984 String Without AAA or BBB 34% Medium
0983 Minimum Cost For Tickets 57% Medium
0982 Triples with Bitwise AND Equal To Zero 54% Hard
0981 Time Based Key-Value Store 51% Medium
0980 Unique Paths III 71% Hard
0979 Distribute Coins in Binary Tree 67% Medium
0978 Longest Turbulent Subarray 45% Medium
0977 Squares of a Sorted Array 71% Easy
0976 Largest Perimeter Triangle 57% Easy
0975 Odd Even Jump 45% Hard
0974 Subarray Sums Divisible by K 47% Medium
0973 K Closest Points to Origin 61% Medium
0972 Equal Rational Numbers 40% Hard
0971 Flip Binary Tree To Match Preorder Traversal 43% Medium
0970 Powerful Integers 39% Easy
0969 Pancake Sorting 62% Medium
0968 Binary Tree Cameras 36% Hard
0967 Numbers With Same Consecutive Differences 38% Medium
0966 Vowel Spellchecker 44% Medium
0965 Univalued Binary Tree 66% Easy
0964 Least Operators to Express Number 41% Hard
0963 Minimum Area Rectangle II 47% Medium
0962 Maximum Width Ramp 43% Medium
0961 N-Repeated Element in Size 2N Array 72% Easy
0960 Delete Columns to Make Sorted III 52% Hard
0959 Regions Cut By Slashes 63% Medium
0958 Check Completeness of a Binary Tree 50% Medium
0957 Prison Cells After N Days 38% Medium
0956 Tallest Billboard 38% Hard
0955 Delete Columns to Make Sorted II 32% Medium
0954 Array of Doubled Pairs 35% Medium
0953 Verifying an Alien Dictionary 55% Easy
0952 Largest Component Size by Common Factor 27% Hard
0951 Flip Equivalent Binary Trees 65% Medium
0950 Reveal Cards In Increasing Order 72% Medium
0949 Largest Time for Given Digits 34% Easy
0948 Bag of Tokens 39% Medium
0947 Most Stones Removed with Same Row or Column 54% Medium
0946 Validate Stack Sequences 58% Medium
0945 Minimum Increment to Make Array Unique 44% Medium
0944 Delete Columns to Make Sorted 69% Easy
0943 Find the Shortest Superstring 40% Hard
0942 DI String Match 70% Easy
0941 Valid Mountain Array 35% Easy
0940 Distinct Subsequences II 40% Hard
0939 Minimum Area Rectangle 51% Medium
0938 Range Sum of BST 78% Easy
0937 Reorder Data in Log Files 54% Easy
0936 Stamping The Sequence 35% Hard
0935 Knight Dialer 42% Medium
0934 Shortest Bridge 45% Medium
0933 Number of Recent Calls 69% Easy
0932 Beautiful Array 54% Medium
0931 Minimum Falling Path Sum 59% Medium
0930 Binary Subarrays With Sum 39% Medium
0929 Unique Email Addresses 68% Easy
0928 Minimize Malware Spread II 39% Hard
0927 Three Equal Parts 31% Hard
0926 Flip String to Monotone Increasing 51% Medium
0925 Long Pressed Name 44% Easy
0924 Minimize Malware Spread 40% Hard
0923 3Sum With Multiplicity 34% Medium
0922 Sort Array By Parity II 67% Easy
0921 Minimum Add to Make Parentheses Valid 70% Medium
0920 Number of Music Playlists 44% Hard
0919 Complete Binary Tree Inserter 55% Medium
0918 Maximum Sum Circular Subarray 33% Medium
0917 Reverse Only Letters 56% Easy
0916 Word Subsets 45% Medium
0915 Partition Array into Disjoint Intervals 43% Medium
0914 X of a Kind in a Deck of Cards 34% Easy
0913 Cat and Mouse 29% Hard
0912 Sort an Array 62% Medium
0911 Online Election 48% Medium
0910 Smallest Range II 24% Medium
0909 Snakes and Ladders 36% Medium
0908 Smallest Range I 64% Easy
0907 Sum of Subarray Minimums 29% Medium
0906 Super Palindromes 30% Hard
0905 Sort Array By Parity 72% Easy
0904 Fruit Into Baskets 41% Medium
0903 Valid Permutations for DI Sequence 46% Hard
0902 Numbers At Most N Given Digit Set 29% Hard
0901 Online Stock Span 51% Medium
0900 RLE Iterator 51% Medium
0899 Orderly Queue 49% Hard
0898 Bitwise ORs of Subarrays 35% Medium
0897 Increasing Order Search Tree 66% Easy
0896 Monotonic Array 56% Easy
0895 Maximum Frequency Stack 58% Hard
0894 All Possible Full Binary Trees 72% Medium
0893 Groups of Special-Equivalent Strings 63% Easy
0892 Surface Area of 3D Shapes 57% Easy
0891 Sum of Subsequence Widths 30% Hard
0890 Find and Replace Pattern 72% Medium
0889 Construct Binary Tree from Preorder and Postorder Traversal 62% Medium
0888 Fair Candy Swap 56% Easy
0887 Super Egg Drop 25% Hard
0886 Possible Bipartition 41% Medium
0885 Spiral Matrix III 66% Medium
0884 Uncommon Words from Two Sentences 61% Easy
0883 Projection Area of 3D Shapes 66% Easy
0882 Reachable Nodes In Subdivided Graph 39% Hard
0881 Boats to Save People 44% Medium
0880 Decoded String at Index 23% Medium
0879 Profitable Schemes 37% Hard
0878 Nth Magical Number 26% Hard
0877 Stone Game 62% Medium
0876 Middle of the Linked List 65% Easy
0875 Koko Eating Bananas 48% Medium
0874 Walking Robot Simulation 33% Easy
0873 Length of Longest Fibonacci Subsequence 47% Medium
0872 Leaf-Similar Trees 64% Easy
0871 Minimum Number of Refueling Stops 30% Hard
0870 Advantage Shuffle 43% Medium
0869 Reordered Power of 2 51% Medium
0868 Binary Gap 59% Easy
0867 Transpose Matrix 63% Easy
0866 Prime Palindrome 21% Medium
0865 Smallest Subtree with all the Deepest Nodes 58% Medium
0864 Shortest Path to Get All Keys 38% Hard
0863 All Nodes Distance K in Binary Tree 50% Medium
0862 Shortest Subarray with Sum at Least K 22% Hard
0861 Score After Flipping Matrix 70% Medium
0860 Lemonade Change 50% Easy
0859 Buddy Strings 27% Easy
0858 Mirror Reflection 52% Medium
0857 Minimum Cost to Hire K Workers 48% Hard
0856 Score of Parentheses 57% Medium
0855 Exam Room 40% Medium
0854 K-Similar Strings 35% Hard
0853 Car Fleet 41% Medium
0852 Peak Index in a Mountain Array 70% Easy
0851 Loud and Rich 49% Medium
0850 Rectangle Area II 46% Hard
0849 Maximize Distance to Closest Person 41% Easy
0848 Shifting Letters 42% Medium
0847 Shortest Path Visiting All Nodes 48% Hard
0846 Hand of Straights 50% Medium
0845 Longest Mountain in Array 35% Medium
0844 Backspace String Compare 46% Easy
0843 Guess the Word 45% Hard
0842 Split Array into Fibonacci Sequence 35% Medium
0841 Keys and Rooms 61% Medium
0840 Magic Squares In Grid 36% Easy
0839 Similar String Groups 36% Hard
0838 Push Dominoes 45% Medium
0837 New 21 Game 32% Medium
0836 Rectangle Overlap 47% Easy
0835 Image Overlap 54% Medium
0834 Sum of Distances in Tree 41% Hard
0833 Find And Replace in String 48% Medium
0832 Flipping an Image 73% Easy
0831 Masking Personal Information 42% Medium
0830 Positions of Large Groups 48% Easy
0829 Consecutive Numbers Sum 35% Hard
0828 Unique Letter String 41% Hard
0827 Making A Large Island 44% Hard
0826 Most Profit Assigning Work 37% Medium
0825 Friends Of Appropriate Ages 39% Medium
0824 Goat Latin 59% Easy
0823 Binary Trees With Factors 33% Medium
0822 Card Flipping Game 41% Medium
0821 Shortest Distance to a Character 64% Easy
0820 Short Encoding of Words 48% Medium
0819 Most Common Word 43% Easy
0818 Race Car 37% Hard
0817 Linked List Components 55% Medium
0816 Ambiguous Coordinates 45% Medium
0815 Bus Routes 41% Hard
0814 Binary Tree Pruning 72% Medium
0813 Largest Sum of Averages 47% Medium
0812 Largest Triangle Area 56% Easy
0811 Subdomain Visit Count 66% Easy
0810 Chalkboard XOR Game 45% Hard
0809 Expressive Words 45% Medium
0808 Soup Servings 38% Medium
0807 Max Increase to Keep City Skyline 82% Medium
0806 Number of Lines To Write String 63% Easy
0805 Split Array With Same Average 25% Hard
0804 Unique Morse Code Words 75% Easy
0803 Bricks Falling When Hit 29% Hard
0802 Find Eventual Safe States 45% Medium
0801 Minimum Swaps To Make Sequences Increasing 36% Medium
0799 Champagne Tower 34% Medium
0798 Smallest Rotation with Highest Score 41% Hard
0797 All Paths From Source to Target 72% Medium
0796 Rotate String 49% Easy
0795 Number of Subarrays with Bounded Maximum 44% Medium
0794 Valid Tic-Tac-Toe State 31% Medium
0793 Preimage Size of Factorial Zeroes Function 39% Hard
0792 Number of Matching Subsequences 45% Medium
0791 Custom Sort String 63% Medium
0790 Domino and Tromino Tiling 37% Medium
0789 Escape The Ghosts 56% Medium
0788 Rotated Digits 55% Easy
0787 Cheapest Flights Within K Stops 36% Medium
0786 K-th Smallest Prime Fraction 41% Hard
0785 Is Graph Bipartite? 45% Medium
0784 Letter Case Permutation 59% Easy
0783 Minimum Distance Between BST Nodes 51% Easy
0782 Transform to Chessboard 39% Hard
0781 Rabbits in Forest 52% Medium
0780 Reaching Points 28% Hard
0779 K-th Symbol in Grammar 37% Medium
0778 Swim in Rising Water 49% Hard
0777 Swap Adjacent in LR String 34% Medium
0775 Global and Local Inversions 40% Medium
0773 Sliding Puzzle 55% Hard
0771 Jewels and Stones 83% Easy
0770 Basic Calculator IV 46% Hard
0769 Max Chunks To Make Sorted 52% Medium
0768 Max Chunks To Make Sorted II 46% Hard
0767 Reorganize String 44% Medium
0766 Toeplitz Matrix 62% Easy
0765 Couples Holding Hands 52% Hard
0764 Largest Plus Sign 44% Medium
0763 Partition Labels 72% Medium
0762 Prime Number of Set Bits in Binary Representation 60% Easy
0761 Special Binary String 53% Hard
0757 Set Intersection Size At Least Two 37% Hard
0756 Pyramid Transition Matrix 52% Medium
0754 Reach a Number 33% Easy
0753 Cracking the Safe 48% Hard
0752 Open the Lock 47% Medium
0749 Contain Virus 42% Hard
0748 Shortest Completing Word 55% Easy
0747 Largest Number At Least Twice of Others 40% Easy
0746 Min Cost Climbing Stairs 48% Easy
0745 Prefix and Suffix Search 32% Hard
0744 Find Smallest Letter Greater Than Target 44% Easy
0743 Network Delay Time 44% Medium
0741 Cherry Pickup 31% Hard
0740 Delete and Earn 47% Medium
0739 Daily Temperatures 61% Medium
0738 Monotone Increasing Digits 42% Medium
0736 Parse Lisp Expression 45% Hard
0735 Asteroid Collision 39% Medium
0733 Flood Fill 52% Easy
0732 My Calendar III 57% Hard
0731 My Calendar II 46% Medium
0730 Count Different Palindromic Subsequences 40% Hard
0729 My Calendar I 49% Medium
0728 Self Dividing Numbers 71% Easy
0726 Number of Atoms 46% Hard
0725 Split Linked List in Parts 50% Medium
0724 Find Pivot Index 42% Easy
0722 Remove Comments 32% Medium
0721 Accounts Merge 43% Medium
0720 Longest Word in Dictionary 46% Easy
0719 Find K-th Smallest Pair Distance 30% Hard
0718 Maximum Length of Repeated Subarray 47% Medium
0717 1-bit and 2-bit Characters 49% Easy
0715 Range Module 36% Hard
0714 Best Time to Buy and Sell Stock with Transaction Fee 52% Medium
0713 Subarray Product Less Than K 37% Medium
0712 Minimum ASCII Delete Sum for Two Strings 55% Medium
0710 Random Pick with Blacklist 32% Hard
0709 To Lower Case 77% Easy
0707 Design Linked List 20% Medium
0706 Design HashMap 57% Easy
0705 Design HashSet 56% Easy
0704 Binary Search 49% Easy
0703 Kth Largest Element in a Stream 47% Easy
0701 Insert into a Binary Search Tree 77% Medium
0700 Search in a Binary Search Tree 69% Easy
0699 Falling Squares 40% Hard
0698 Partition to K Equal Sum Subsets 43% Medium
0697 Degree of an Array 51% Easy
0696 Count Binary Substrings 54% Easy
0695 Max Area of Island 59% Medium
0693 Binary Number with Alternating Bits 58% Easy
0692 Top K Frequent Words 47% Medium
0691 Stickers to Spell Word 40% Hard
0689 Maximum Sum of 3 Non-Overlapping Subarrays 44% Hard
0688 Knight Probability in Chessboard 46% Medium
0687 Longest Univalue Path 34% Easy
0686 Repeated String Match 31% Easy
0685 Redundant Connection II 31% Hard
0684 Redundant Connection 54% Medium
0682 Baseball Game 61% Easy
0680 Valid Palindrome II 35% Easy
0679 24 Game 44% Hard
0678 Valid Parenthesis String 33% Medium
0677 Map Sum Pairs 52% Medium
0676 Implement Magic Dictionary 52% Medium
0675 Cut Off Trees for Golf Event 32% Hard
0674 Longest Continuous Increasing Subsequence 44% Easy
0673 Number of Longest Increasing Subsequence 34% Medium
0672 Bulb Switcher II 50% Medium
0671 Second Minimum Node In a Binary Tree 43% Easy
0670 Maximum Swap 41% Medium
0669 Trim a Binary Search Tree 61% Easy
0668 Kth Smallest Number in Multiplication Table 43% Hard
0667 Beautiful Arrangement II 52% Medium
0665 Non-decreasing Array 19% Easy
0664 Strange Printer 38% Hard
0662 Maximum Width of Binary Tree 39% Medium
0661 Image Smoother 49% Easy
0659 Split Array into Consecutive Subsequences 42% Medium
0658 Find K Closest Elements 39% Medium
0657 Robot Return to Origin 72% Easy
0655 Print Binary Tree 52% Medium
0654 Maximum Binary Tree 77% Medium
0653 Two Sum IV - Input is a BST 53% Easy
0652 Find Duplicate Subtrees 47% Medium
0650 2 Keys Keyboard 47% Medium
0649 Dota2 Senate 38% Medium
0648 Replace Words 53% Medium
0647 Palindromic Substrings 58% Medium
0646 Maximum Length of Pair Chain 49% Medium
0645 Set Mismatch 41% Easy
0643 Maximum Average Subarray I 40% Easy
0641 Design Circular Deque 50% Medium
0640 Solve the Equation 40% Medium
0639 Decode Ways II 25% Hard
0638 Shopping Offers 50% Medium
0637 Average of Levels in Binary Tree 60% Easy
0636 Exclusive Time of Functions 49% Medium
0633 Sum of Square Numbers 32% Easy
0632 Smallest Range Covering Elements from K Lists 49% Hard
0630 Course Schedule III 32% Hard
0629 K Inverse Pairs Array 29% Hard
0628 Maximum Product of Three Numbers 46% Easy
0623 Add One Row to Tree 47% Medium
0622 Design Circular Queue 41% Medium
0621 Task Scheduler 46% Medium
0617 Merge Two Binary Trees 71% Easy
0611 Valid Triangle Number 46% Medium
0609 Find Duplicate File in System 56% Medium
0606 Construct String from Binary Tree 52% Easy
0605 Can Place Flowers 31% Easy
0600 Non-negative Integers without Consecutive Ones 33% Hard
0599 Minimum Index Sum of Two Lists 48% Easy
0598 Range Addition II 49% Easy
0594 Longest Harmonious Subsequence 44% Easy
0593 Valid Square 41% Medium
0592 Fraction Addition and Subtraction 47% Medium
0591 Tag Validator 33% Hard
0587 Erect the Fence 34% Hard
0583 Delete Operation for Two Strings 46% Medium
0581 Shortest Unsorted Continuous Subarray 30% Easy
0576 Out of Boundary Paths 33% Medium
0575 Distribute Candies 60% Easy
0572 Subtree of Another Tree 42% Easy
0567 Permutation in String 39% Medium
0566 Reshape the Matrix 59% Easy
0565 Array Nesting 53% Medium
0564 Find the Closest Palindrome 19% Hard
0563 Binary Tree Tilt 47% Easy
0561 Array Partition I 70% Easy
0560 Subarray Sum Equals K 43% Medium
0557 Reverse Words in a String III 66% Easy
0556 Next Greater Element III 30% Medium
0554 Brick Wall 48% Medium
0553 Optimal Division 55% Medium
0552 Student Attendance Record II 34% Hard
0551 Student Attendance Record I 46% Easy
0547 Friend Circles 55% Medium
0546 Remove Boxes 39% Hard
0543 Diameter of Binary Tree 47% Easy
0542 01 Matrix 37% Medium
0541 Reverse String II 46% Easy
0540 Single Element in a Sorted Array 57% Medium
0539 Minimum Time Difference 49% Medium
0538 Convert BST to Greater Tree 52% Easy
0537 Complex Number Multiplication 66% Medium
0532 K-diff Pairs in an Array 30% Easy
0530 Minimum Absolute Difference in BST 51% Easy
0529 Minesweeper 55% Medium
0528 Random Pick with Weight 43% Medium
0526 Beautiful Arrangement 55% Medium
0525 Contiguous Array 43% Medium
0524 Longest Word in Dictionary through Deleting 46% Medium
0523 Continuous Subarray Sum 24% Medium
0522 Longest Uncommon Subsequence II 33% Medium
0521 Longest Uncommon Subsequence I 56% Easy
0520 Detect Capital 52% Easy
0519 Random Flip Matrix 34% Medium
0518 Coin Change 2 44% Medium
0517 Super Washing Machines 37% Hard
0516 Longest Palindromic Subsequence 49% Medium
0515 Find Largest Value in Each Tree Row 58% Medium
0514 Freedom Trail 41% Hard
0513 Find Bottom Left Tree Value 59% Medium
0509 Fibonacci Number 66% Easy
0508 Most Frequent Subtree Sum 55% Medium
0507 Perfect Number 35% Easy
0506 Relative Ranks 49% Easy
0504 Base 7 45% Easy
0503 Next Greater Element II 52% Medium
0502 IPO 38% Hard
0501 Find Mode in Binary Search Tree 40% Easy
0500 Keyboard Row 63% Easy
0498 Diagonal Traverse 46% Medium
0497 Random Point in Non-overlapping Rectangles 36% Medium
0496 Next Greater Element I 61% Easy
0495 Teemo Attacking 52% Medium
0494 Target Sum 45% Medium
0493 Reverse Pairs 23% Hard
0492 Construct the Rectangle 48% Easy
0491 Increasing Subsequences 43% Medium
0488 Zuma Game 40% Hard
0486 Predict the Winner 47% Medium
0485 Max Consecutive Ones 55% Easy
0483 Smallest Good Base 34% Hard
0482 License Key Formatting 41% Easy
0481 Magical String 46% Medium
0480 Sliding Window Median 34% Hard
0479 Largest Palindrome Product 27% Hard
0478 Generate Random Point in a Circle 37% Medium
0477 Total Hamming Distance 49% Medium
0476 Number Complement 62% Easy
0475 Heaters 32% Easy
0474 Ones and Zeroes 40% Medium
0473 Matchsticks to Square 36% Medium
0472 Concatenated Words 37% Hard
0470 Implement Rand10() Using Rand7() 45% Medium
0468 Validate IP Address 21% Medium
0467 Unique Substrings in Wraparound String 34% Medium
0466 Count The Repetitions 27% Hard
0464 Can I Win 28% Medium
0463 Island Perimeter 62% Easy
0462 Minimum Moves to Equal Array Elements II 52% Medium
0461 Hamming Distance 70% Easy
0460 LFU Cache 30% Hard
0459 Repeated Substring Pattern 40% Easy
0458 Poor Pigs 46% Hard
0457 Circular Array Loop 28% Medium
0456 132 Pattern 27% Medium
0455 Assign Cookies 48% Easy
0454 4Sum II 51% Medium
0453 Minimum Moves to Equal Array Elements 49% Easy
0452 Minimum Number of Arrows to Burst Balloons 47% Medium
0451 Sort Characters By Frequency 57% Medium
0450 Delete Node in a BST 40% Medium
0448 Find All Numbers Disappeared in an Array 54% Easy
0447 Number of Boomerangs 50% Easy
0446 Arithmetic Slices II - Subsequence 31% Hard
0445 Add Two Numbers II 51% Medium
0443 String Compression 38% Easy
0442 Find All Duplicates in an Array 62% Medium
0441 Arranging Coins 38% Easy
0440 K-th Smallest in Lexicographical Order 27% Hard
0438 Find All Anagrams in a String 39% Medium
0437 Path Sum III 44% Easy
0436 Find Right Interval 43% Medium
0435 Non-overlapping Intervals 41% Medium
0434 Number of Segments in a String 37% Easy
0433 Minimum Genetic Mutation 39% Medium
0432 All O`one Data Structure 30% Hard
0424 Longest Repeating Character Replacement 44% Medium
0423 Reconstruct Original Digits from English 46% Medium
0421 Maximum XOR of Two Numbers in an Array 52% Medium
0420 Strong Password Checker 16% Hard
0419 Battleships in a Board 66% Medium
0417 Pacific Atlantic Water Flow 38% Medium
0416 Partition Equal Subset Sum 41% Medium
0415 Add Strings 45% Easy
0414 Third Maximum Number 29% Easy
0413 Arithmetic Slices 56% Medium
0412 Fizz Buzz 60% Easy
0410 Split Array Largest Sum 43% Hard
0409 Longest Palindrome 48% Easy
0407 Trapping Rain Water II 40% Hard
0406 Queue Reconstruction by Height 61% Medium
0405 Convert a Number to Hexadecimal 42% Easy
0404 Sum of Left Leaves 49% Easy
0403 Frog Jump 37% Hard
0402 Remove K Digits 27% Medium
0401 Binary Watch 45% Easy
0400 Nth Digit 30% Medium
0399 Evaluate Division 49% Medium
0398 Random Pick Index 51% Medium
0397 Integer Replacement 32% Medium
0396 Rotate Function 35% Medium
0395 Longest Substring with At Least K Repeating Characters 39% Medium
0394 Decode String 47% Medium
0393 UTF-8 Validation 36% Medium
0392 Is Subsequence 47% Easy
0391 Perfect Rectangle 28% Hard
0390 Elimination Game 43% Medium
0389 Find the Difference 53% Easy
0388 Longest Absolute File Path 40% Medium
0387 First Unique Character in a String 50% Easy
0386 Lexicographical Numbers 48% Medium
0385 Mini Parser 32% Medium
0384 Shuffle an Array 51% Medium
0383 Ransom Note 50% Easy
0382 Linked List Random Node 50% Medium
0381 Insert Delete GetRandom O(1) - Duplicates allowed 32% Hard
0380 Insert Delete GetRandom O(1) 44% Medium
0378 Kth Smallest Element in a Sorted Matrix 51% Medium
0377 Combination Sum IV 44% Medium
0376 Wiggle Subsequence 38% Medium
0375 Guess Number Higher or Lower II 38% Medium
0373 Find K Pairs with Smallest Sums 34% Medium
0372 Super Pow 36% Medium
0371 Sum of Two Integers 50% Easy
0368 Largest Divisible Subset 35% Medium
0367 Valid Perfect Square 40% Easy
0365 Water and Jug Problem 29% Medium
0363 Max Sum of Rectangle No Larger Than K 35% Hard
0357 Count Numbers with Unique Digits 47% Medium
0355 Design Twitter 28% Medium
0354 Russian Doll Envelopes 34% Hard
0352 Data Stream as Disjoint Intervals 44% Hard
0350 Intersection of Two Arrays II 49% Easy
0349 Intersection of Two Arrays 57% Easy
0347 Top K Frequent Elements 57% Medium
0345 Reverse Vowels of a String 42% Easy
0344 Reverse String 64% Easy
0343 Integer Break 48% Medium
0342 Power of Four 40% Easy
0338 Counting Bits 65% Medium
0337 House Robber III 49% Medium
0336 Palindrome Pairs 32% Hard
0335 Self Crossing 27% Hard
0334 Increasing Triplet Subsequence 39% Medium
0332 Reconstruct Itinerary 33% Medium
0331 Verify Preorder Serialization of a Binary Tree 39% Medium
0330 Patching Array 33% Hard
0329 Longest Increasing Path in a Matrix 41% Hard
0328 Odd Even Linked List 50% Medium
0327 Count of Range Sum 33% Hard
0326 Power of Three 41% Easy
0324 Wiggle Sort II 28% Medium
0322 Coin Change 32% Medium
0321 Create Maximum Number 25% Hard
0319 Bulb Switcher 44% Medium
0318 Maximum Product of Word Lengths 49% Medium
0316 Remove Duplicate Letters 33% Hard
0315 Count of Smaller Numbers After Self 39% Hard
0313 Super Ugly Number 42% Medium
0312 Burst Balloons 48% Hard
0310 Minimum Height Trees 31% Medium
0309 Best Time to Buy and Sell Stock with Cooldown 45% Medium
0307 Range Sum Query - Mutable 30% Medium
0306 Additive Number 28% Medium
0304 Range Sum Query 2D - Immutable 34% Medium
0303 Range Sum Query - Immutable 40% Easy
0301 Remove Invalid Parentheses 40% Hard
0300 Longest Increasing Subsequence 41% Medium
0299 Bulls and Cows 40% Easy
0295 Find Median from Data Stream 39% Hard
0292 Nim Game 55% Easy
0290 Word Pattern 35% Easy
0289 Game of Life 49% Medium
0287 Find the Duplicate Number 51% Medium
0283 Move Zeroes 55% Easy
0282 Expression Add Operators 34% Hard
0279 Perfect Squares 43% Medium
0275 H-Index II 35% Medium
0274 H-Index 34% Medium
0273 Integer to English Words 25% Hard
0268 Missing Number 49% Easy
0264 Ugly Number II 37% Medium
0263 Ugly Number 41% Easy
0260 Single Number III 58% Medium
0258 Add Digits 55% Easy
0257 Binary Tree Paths 47% Easy
0242 Valid Anagram 54% Easy
0241 Different Ways to Add Parentheses 52% Medium
0240 Search a 2D Matrix II 41% Medium
0239 Sliding Window Maximum 39% Hard
0238 Product of Array Except Self 57% Medium
0237 Delete Node in a Linked List 56% Easy
0236 Lowest Common Ancestor of a Binary Tree 40% Medium
0235 Lowest Common Ancestor of a Binary Search Tree 46% Easy
0234 Palindrome Linked List 37% Easy
0233 Number of Digit One 30% Hard
0232 Implement Queue using Stacks 45% Easy
0231 Power of Two 42% Easy
0230 Kth Smallest Element in a BST 54% Medium
0229 Majority Element II 33% Medium
0228 Summary Ranges 37% Medium
0227 Basic Calculator II 34% Medium
0226 Invert Binary Tree 60% Easy
0225 Implement Stack using Queues 41% Easy
0224 Basic Calculator 34% Hard
0223 Rectangle Area 36% Medium
0222 Count Complete Tree Nodes 38% Medium
0221 Maximal Square 34% Medium
0220 Contains Duplicate III 20% Medium
0219 Contains Duplicate II 36% Easy
0218 The Skyline Problem 32% Hard
0217 Contains Duplicate 53% Easy
0216 Combination Sum III 53% Medium
0215 Kth Largest Element in an Array 50% Medium
0214 Shortest Palindrome 28% Hard
0213 House Robber II 35% Medium
0212 Word Search II 30% Hard
0211 Add and Search Word - Data structure design 32% Medium
0210 Course Schedule II 36% Medium
0209 Minimum Size Subarray Sum 35% Medium
0208 Implement Trie (Prefix Tree) 41% Medium
0207 Course Schedule 39% Medium
0206 Reverse Linked List 57% Easy
0205 Isomorphic Strings 38% Easy
0204 Count Primes 30% Easy
0203 Remove Linked List Elements 36% Easy
0202 Happy Number 47% Easy
0201 Bitwise AND of Numbers Range 36% Medium
0200 Number of Islands 43% Medium
0199 Binary Tree Right Side View 50% Medium
0198 House Robber 41% Easy
0191 Number of 1 Bits 45% Easy
0190 Reverse Bits 33% Easy
0189 Rotate Array 31% Easy
0188 Best Time to Buy and Sell Stock IV 27% Hard
0187 Repeated DNA Sequences 37% Medium
0179 Largest Number 26% Medium
0174 Dungeon Game 28% Hard
0173 Binary Search Tree Iterator 51% Medium
0172 Factorial Trailing Zeroes 37% Easy
0171 Excel Sheet Column Number 52% Easy
0169 Majority Element 54% Easy
0168 Excel Sheet Column Title 29% Easy
0167 Two Sum II - Input array is sorted 51% Easy
0166 Fraction to Recurring Decimal 20% Medium
0165 Compare Version Numbers 25% Medium
0164 Maximum Gap 33% Hard
0162 Find Peak Element 42% Medium
0160 Intersection of Two Linked Lists 36% Easy
0155 Min Stack 39% Easy
0154 Find Minimum in Rotated Sorted Array II 39% Hard
0153 Find Minimum in Rotated Sorted Array 43% Medium
0152 Maximum Product Subarray 30% Medium
0150 Evaluate Reverse Polish Notation 33% Medium
0149 Max Points on a Line 16% Hard
0148 Sort List 37% Medium
0147 Insertion Sort List 38% Medium
0146 LRU Cache 28% Medium
0145 Binary Tree Postorder Traversal 50% Hard
0144 Binary Tree Preorder Traversal 53% Medium
0143 Reorder List 32% Medium
0142 Linked List Cycle II 34% Medium
0141 Linked List Cycle 38% Easy
0140 Word Break II 28% Hard
0139 Word Break 37% Medium
0137 Single Number II 47% Medium
0136 Single Number 61% Easy
0135 Candy 29% Hard
0134 Gas Station 35% Medium
0132 Palindrome Partitioning II 28% Hard
0131 Palindrome Partitioning 43% Medium
0130 Surrounded Regions 24% Medium
0129 Sum Root to Leaf Numbers 44% Medium
0128 Longest Consecutive Sequence 43% Hard
0127 Word Ladder 26% Medium
0126 Word Ladder II 19% Hard
0125 Valid Palindrome 32% Easy
0124 Binary Tree Maximum Path Sum 31% Hard
0123 Best Time to Buy and Sell Stock III 35% Hard
0122 Best Time to Buy and Sell Stock II 53% Easy
0121 Best Time to Buy and Sell Stock 48% Easy
0120 Triangle 41% Medium
0119 Pascal's Triangle II 45% Easy
0118 Pascal's Triangle 48% Easy
0115 Distinct Subsequences 36% Hard
0114 Flatten Binary Tree to Linked List 44% Medium
0113 Path Sum II 42% Medium
0112 Path Sum 39% Easy
0111 Minimum Depth of Binary Tree 36% Easy
0110 Balanced Binary Tree 42% Easy
0109 Convert Sorted List to Binary Search Tree 43% Medium
0108 Convert Sorted Array to Binary Search Tree 53% Easy
0107 Binary Tree Level Order Traversal II 48% Easy
0106 Construct Binary Tree from Inorder and Postorder Traversal 41% Medium
0105 Construct Binary Tree from Preorder and Inorder Traversal 43% Medium
0104 Maximum Depth of Binary Tree 62% Easy
0103 Binary Tree Zigzag Level Order Traversal 43% Medium
0102 Binary Tree Level Order Traversal 50% Medium
0101 Symmetric Tree 44% Easy
0100 Same Tree 51% Easy
0099 Recover Binary Search Tree 36% Hard
0098 Validate Binary Search Tree 26% Medium
0097 Interleaving String 29% Hard
0096 Unique Binary Search Trees 48% Medium
0095 Unique Binary Search Trees II 37% Medium
0094 Binary Tree Inorder Traversal 59% Medium
0093 Restore IP Addresses 32% Medium
0092 Reverse Linked List II 36% Medium
0091 Decode Ways 23% Medium
0090 Subsets II 44% Medium
0089 Gray Code 47% Medium
0088 Merge Sorted Array 37% Easy
0087 Scramble String 32% Hard
0086 Partition List 38% Medium
0085 Maximal Rectangle 35% Hard
0084 Largest Rectangle in Histogram 32% Hard
0083 Remove Duplicates from Sorted List 43% Easy
0082 Remove Duplicates from Sorted List II 34% Medium
0081 Search in Rotated Sorted Array II 32% Medium
0080 Remove Duplicates from Sorted Array II 41% Medium
0079 Word Search 32% Medium
0078 Subsets 56% Medium
0077 Combinations 50% Medium
0076 Minimum Window Substring 32% Hard
0075 Sort Colors 43% Medium
0074 Search a 2D Matrix 35% Medium
0073 Set Matrix Zeroes 41% Medium
0072 Edit Distance 40% Hard
0071 Simplify Path 30% Medium
0070 Climbing Stairs 45% Easy
0069 Sqrt(x) 32% Easy
0068 Text Justification 24% Hard
0067 Add Binary 41% Easy
0066 Plus One 41% Easy
0065 Valid Number 14% Hard
0064 Minimum Path Sum 49% Medium
0063 Unique Paths II 33% Medium
0062 Unique Paths 49% Medium
0061 Rotate List 28% Medium
0060 Permutation Sequence 34% Medium
0059 Spiral Matrix II 49% Medium
0058 Length of Last Word 32% Easy
0057 Insert Interval 32% Hard
0056 Merge Intervals 37% Medium
0055 Jump Game 32% Medium
0054 Spiral Matrix 31% Medium
0053 Maximum Subarray 44% Easy
0052 N-Queens II 54% Hard
0051 N-Queens 42% Hard
0050 Pow(x, n) 28% Medium
0049 Group Anagrams 50% Medium
0048 Rotate Image 51% Medium
0047 Permutations II 42% Medium
0046 Permutations 58% Medium
0045 Jump Game II 29% Hard
0044 Wildcard Matching 23% Hard
0043 Multiply Strings 31% Medium
0042 Trapping Rain Water 45% Hard
0041 First Missing Positive 30% Hard
0040 Combination Sum II 44% Medium
0039 Combination Sum 51% Medium
0038 Count and Say 42% Easy
0037 Sudoku Solver 39% Hard
0036 Valid Sudoku 45% Medium
0035 Search Insert Position 41% Easy
0034 Find First and Last Position of Element in Sorted Array 34% Medium
0033 Search in Rotated Sorted Array 33% Medium
0032 Longest Valid Parentheses 26% Hard
0031 Next Permutation 31% Medium
0030 Substring with Concatenation of All Words 24% Hard
0029 Divide Two Integers 16% Medium
0028 Implement strStr() 33% Easy
0027 Remove Element 45% Easy
0026 Remove Duplicates from Sorted Array 42% Easy
0025 Reverse Nodes in k-Group 38% Hard
0024 Swap Nodes in Pairs 46% Medium
0023 Merge k Sorted Lists 36% Hard
0022 Generate Parentheses 57% Medium
0021 Merge Two Sorted Lists 49% Easy
0020 Valid Parentheses 37% Easy
0019 Remove Nth Node From End of List 34% Medium
0018 4Sum 31% Medium
0017 Letter Combinations of a Phone Number 43% Medium
0016 3Sum Closest 45% Medium
0015 3Sum 25% Medium
0014 Longest Common Prefix 34% Easy
0013 Roman to Integer 53% Easy
0012 Integer to Roman 52% Medium
0011 Container With Most Water 47% Medium
0010 Regular Expression Matching 25% Hard
0009 Palindrome Number 45% Easy
0008 String to Integer (atoi) 14% Medium
0007 Reverse Integer 25% Easy
0006 ZigZag Conversion 33% Medium
0005 Longest Palindromic Substring 28% Medium
0004 Median of Two Sorted Arrays 27% Hard
0003 Longest Substring Without Repeating Characters 29% Medium
0002 Add Two Numbers 32% Medium
0001 Two Sum 44% Easy

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

helper

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

notes

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

kit

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

致谢

感谢所有贡献者的辛苦付出

感谢 JetBrains

GoLand

About

Go Solution for LeetCode algorithms problems, 100% coverage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%