LeetCode-in-Go

module
Version: v0.0.0-...-db5e768 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2019 License: MIT

README

LeetCode 的 Go 解答

LeetCode 排名 codecov Build Status Go

进度

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

Easy Medium Hard Total
Accepted 253 428 180 861
Total 255 437 182 874

题解

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

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

helper

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

notes

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

kit

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

Directories

Path Synopsis
Algorithms
routine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL