Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zeromake/leetcode


https://github.com/zeromake/leetcode

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# LeetCode

![Go](https://github.com/zeromake/leetcode/workflows/Go/badge.svg?branch=master)

## Todo

- [x] [0001-twoSum](pkg/arrays/twoSum.go): `array`, `dynamic-programming`
- [x] [0002-addTwoNumbers](pkg/links/addTwoNumbers.go): `link`, `math`
- [x] [0003-lengthOfLongestSubstring](pkg/strings/lengthOfLongestSubstring.go): `string`, `sliding-window`
- [x] [0004-medianOfTwoSortedArrays](pkg/arrays/findMedian.go): `array`, `median`
- [x] [0005-longestPalindrome](pkg/strings/longestPalindrome.go): `string`
- [x] [0006-zConvert](pkg/strings/zConvert.go): `string`
- [x] [0007-reverse](pkg/math/reverse.go): `number`, `reverse`, `bit`
- [x] [0008-atoi](pkg/strings/atoi.go): `string`
- [x] [0009-isPalindrome](pkg/math/isPalindrome.go): `math`, `bit`
- [x] [0010-isMatch](pkg/strings/isMatch.go): `string`, `match`, `backtracking`
- [x] [0011-maxArea](pkg/math/maxArea.go): `math`, `ptr`
- [x] [0012-intToRoman](pkg/math/intToRoman.go): `math`, `bit`
- [x] [0013-romanToInt](pkg/math/romanToInt.go): `math`, `bit`
- [x] [0014-longestCommonPrefix](pkg/strings/longestCommonPrefix.go): `string`
- [x] [0015-threeSum](pkg/arrays/threeSum.go): `array`, `sum`
- [x] [0016-threeSumClosest](pkg/arrays/threeSumClosest.go): `array`, `sum`
- [x] [0017-letterCombinations](pkg/strings/letterCombinations.go): `string`, `backtracking`
- [x] [0018-fourSum](pkg/arrays/fourSum.go): `array`, `sum`
- [x] [0019-removeNthFromEnd](pkg/links/removeNthFromEnd.go): `link`, `ptr`
- [x] [0020-isValid](pkg/strings/isValid.go): `string`, `stack`, `match`
- [x] [0021-mergeTwoLists](pkg/links/mergeTwoLists.go): `link`, `merge`, `sort`
- [x] [0022-generateParenthesis](pkg/strings/generateParenthesis.go): `string`, `backtracking`
- [x] [0023-mergeKLists](pkg/links/mergeKLists.go): `link`, `merge`, `sort`
- [x] [0024-swapPairs](pkg/links/swapPairs.go): `swap`, `link`
- [x] [0025-reverseKGroup](pkg/links/reverseKGroup.go): `link`, `reverse`
- [x] [0026-removeDuplicates](pkg/arrays/removeDuplicates.go): `array`, `remove`, `zero-memory`
- [x] [0027-removeElement](pkg/arrays/removeElement.go): `array`, `remove`, `zero-memory`
- [x] [0028-strStr](pkg/strings/strStr.go): `string`, `find`, `substring`
- [x] [0029-divide](pkg/math/divide.go): `divide`, `<<`, `>>`, `-`
- [x] [0030-findSubstring](pkg/strings/findSubstring.go): `string`, `hashmap`
- [x] [0031-nextPermutation](pkg/math/nextPermutation.go): `array`, `math`
- [x] [0032-longestValidParentheses](pkg/strings/longestValidParentheses.go): `string`, `()`
- [x] [0033-rotatedSearch](pkg/arrays/rotatedSearch.go): `array`, `sort`, `rotated`
- [x] [0034-searchRange](pkg/arrays/searchRange.go): `array`, `search`, `range`
- [x] [0035-searchInsert](pkg/arrays/searchInsert.go): `array`, `search`
- [x] [0036-isValidSudoku](pkg/matrix/isValidSudoku.go): `matrix`, `sudoku`
- [x] [0037-solveSudoku](pkg/matrix/solveSudoku.go): `matrix`, `sudoku`, `backtracking`
- [x] [0038-countArraySay](pkg/strings/countArraySay.go): `count`, `say`
- [x] [0039-combinationSum](pkg/arrays/combinationSum.go): `array`, `find set`, `sum`, `backtracking`
- [x] [0040-combinationSum2](pkg/arrays/combinationSum2.go): `array`, `find set`, `sum`, `backtracking`
- [x] [0041-firstMissingPositive](pkg/arrays/firstMissingPositive.go): `array`, `find`
- [x] [0042-trap](pkg/arrays/trap.go): `array`, `ptr`
- [x] [0043-multiply](pkg/math/multiply.go): `string`, `multiply`
- [x] [0044-isMatchWildcard](pkg/strings/isMatchWildcard.go): `string`, `match`, `backtracking`
- [x] [0045-jump](pkg/arrays/jump.go): `array`, `math`
- [x] [0046-permute](pkg/arrays/permute.go): `array`, `permute`, `backtracking`
- [x] [0047-permuteUnique](pkg/arrays/permuteUnique.go): `array`, `permute`, `unique`, `backtracking`
- [x] [0048-rotate](pkg/matrix/rotate.go): `rotate`, `matrix`
- [x] [0049-groupAnagrams](pkg/strings/groupAnagrams.go): `array`, `string`
- [x] [0050-myPow](pkg/math/myPow.go): `math`, `pow`
- [x] [0051-solveNQueens](pkg/matrix/solveNQueens.go): `matrix`, `backtracking`
- [x] [0052-totalNQueens](pkg/matrix/totalNQueens.go): `matrix`, `backtracking`
- [x] [0053-maxSubArray](pkg/arrays/maxSubArray.go): `array`, `max`, `subarray`
- [x] [0054-spiralOrder](pkg/matrix/spiralOrder.go): `matrix`, `order`
- [x] [0055-canJump](pkg/arrays/canJump.go): `array`
- [x] [0056-mergeIntervals](pkg/arrays/mergeIntervals.go): `array`, `merge`
- [x] [0057-insertIntervals](pkg/arrays/insertIntervals.go): `array`, `insert`
- [x] [0058-lengthOfLastWord](pkg/strings/lengthOfLastWord.go): `string`, `last`
- [x] [0059-generateSpiralMatrix](pkg/matrix/generateSpiralMatrix.go): `generate`, `spiral`, `matrix`
- [x] [0060-getPermutation](pkg/arrays/getPermutation.go): `combination`, `backtracking`
- [x] [0061-rotateRight](pkg/links/rotateRight.go): `link`, `rotate`
- [x] [0062-uniquePaths](pkg/matrix/uniquePaths.go): `dp`
- [x] [0063-uniquePathsWithObstacles](pkg/matrix/uniquePathsWithObstacles.go): `dp`
- [x] [0064-minPathSum](pkg/matrix/minPathSum.go): `min`, `path`, `sum`
- [x] [0065-isNumber](pkg/strings/isNumber.go): `string`, `isNumber`
- [x] [0066-plusOne](pkg/arrays/plusOne.go): `array`
- [x] [0067-addBinary](pkg/strings/addBinary.go): `add`, `string`, `binary`
- [x] [0068-fullJustify](pkg/strings/fullJustify.go): `full`, `justify`, `string`
- [x] [0069-mySqrt](pkg/math/mySqrt.go): `math`, `sqrt`
- [x] [0070-climbStairs](pkg/math/climbStairs.go): `math`, `fib`
- [x] [0071-simplifyPath](pkg/strings/simplifyPath.go): `string`, `clear`, `path`
- [x] [0072-minDistance](pkg/strings/minDistance.go): `string`
- [x] [0073-setZeroes](pkg/matrix/setZeroes.go): `matrix`, `zero`
- [x] [0074-searchMatrix](pkg/matrix/searchMatrix.go): `matrix`, `search`, `sort-array`, `binary-search`
- [x] [0075-sortColors](pkg/arrays/sortColors.go): `array`, `sort`
- [x] [0076-minWindow](pkg/strings/minWindow.go): `string`, `sliding window`
- [x] [0077-combine](pkg/arrays/combine.go): `array`, `combine`, `backtracking`
- [x] [0078-subsets](pkg/arrays/subsets.go): `array`, `combine`, `backtracking`
- [x] [0079-exits](pkg/matrix/exist.go): `matrix`, `backtracking`
- [x] [0080-removeDuplicatesCount](pkg/arrays/removeDuplicatesCount.go): `array`, `remove duplicates`
- [x] [0081-rotatedSearchDuplicate](pkg/arrays/rotatedSearchDuplicate.go): `array`, `search`
- [x] [0082-deleteDuplicatesII](pkg/links/deleteDuplicatesII.go): `link`
- [x] [0083-deleteDuplicatesI](pkg/links/deleteDuplicatesI.go): `link`
- [x] [0084-largestRectangleArea](pkg/arrays/largestRectangleArea.go): `array`, `stack`
- [x] [0085-maximalRectangle](pkg/matrix/maximalRectangle.go): `matrix`, `dp`
- [x] [0086-partitionLink](pkg/links/partitionLink.go): `link`, `partition`
- [x] [0087-isScramble](pkg/strings/isScramble.go): `string`, `dp`
- [x] [0088-mergeSort](pkg/arrays/mergeSort.go): `array`, `merge`, `sort`
- [x] [0089-grayCode](pkg/math/grayCode.go): `bit`
- [x] [0090-subsetsWithDup](pkg/arrays/subsetsWithDup.go): `array`, `combine`, `backtracking`
- [x] [0091-numDecodings](pkg/strings/numDecodings.go): `string`, `decode`
- [x] [0092-reverseBetween](pkg/links/reverseBetween.go): `link`, `reverse`
- [x] [0093-restoreIpAddresses](pkg/strings/restoreIpAddresses.go): `string`, `ip`, `backtracking`
- [x] [0094-inorderTraversal](pkg/trees/inorderTraversal.go): `tree`, `stack`
- [x] [0095-generateTree](pkg/trees/generateTrees.go): `tree`
- [x] [0096-numTrees](pkg/trees/numTrees.go): `tree`, `math`
- [x] [0097-isInterleave](pkg/strings/isInterleave.go): `string`, `dp`
- [x] [0098-isValidBST](pkg/trees/isValidBST.go): `tree`, `search tree`
- [x] [0099-recoverTree](pkg/trees/recoverTree.go): `tree`, `search tree`
- [x] [0100-isSameTree](pkg/trees/isSameTree.go): `tree`, `same`
- [x] [0101-isSymmetric](pkg/trees/isSymmetric.go): `tree`, `symmetric`
- [x] [0102-levelOrder](pkg/trees/levelOrder.go): `tree`, `bfs`
- [x] [0103-zigzagLevelOrder](pkg/trees/zigzagLevelOrder.go): `tree`, `bfs`
- [x] [0104-maxDepth](pkg/trees/maxDepth.go): `tree`, `bfs`
- [x] [0105-buildPreTree](pkg/trees/buildPreTree.go): `tree`
- [x] [0106-buildPostTree](pkg/trees/buildPostTree.go): `tree`
- [x] [0107-levelOrderBottom](pkg/trees/levelOrderBottom.go): `tree`
- [x] [0108-sortedArrayToBST](pkg/trees/sortedArrayToBST.go): `tree`
- [x] [0109-sortedListToBST](pkg/trees/sortedListToBST.go): `tree`, `link`
- [x] [0110-isBalanced](pkg/trees/isBalanced.go): `tree`
- [x] [0111-minDepth](pkg/trees/minDepth.go): `tree`, `depth`
- [x] [0112-hasPathSum](pkg/trees/hasPathSum.go): `tree`, `bfs`
- [x] [0113-pathSum](pkg/trees/pathSum.go): `tree`, `dfs`, `backtracking`
- [x] [0114-flatten](pkg/trees/flatten.go): `tree`, `dfs`
- [x] [0115-numDistinct](pkg/strings/numDistinct.go): `string`, `dp`
- [x] [0116-connect](pkg/trees/connect.go): `tree`, `bfs`
- [x] [0117-connect-II](pkg/trees/connect.go): `tree`, `bfs`
- [x] [0118-generateTriangle](pkg/arrays/generateTriangle.go): `array`
- [x] [0119-getRowTriangle](pkg/arrays/getRowTriangle.go): `array`
- [x] [0120-minimumTotal](pkg/arrays/minimumTotal.go): `array`, `dp`
- [x] [0121-maxProfit](pkg/arrays/maxProfit.go): `array`
- [x] [0122-maxProfitII](pkg/arrays/maxProfitII.go): `array`
- [x] [0122-maxProfitIII](pkg/arrays/maxProfitIII.go): `array`
- [x] [0124-maxPathSum](pkg/trees/maxPathSum.go): `tree`, `dfs`
- [x] [0125-isPalindrome](pkg/strings/isPalindrome.go): `string`
- [x] [0126-findLadders](pkg/strings/findLadders.go): `string`, `backtracking`
- [x] [0127-ladderLength](pkg/strings/ladderLength.go): `string`, `queue`
- [x] [0128-longestConsecutive](pkg/arrays/longestConsecutive.go): `array`, `set`
- [x] [0130-solve](pkg/matrix/solve.go): `matrix`, `dfs`
- [x] [0133-cloneGraph](pkg/graph/cloneGraph.go): `graph`, `bfs`
- [x] [0136-singleNumber](pkg/math/singleNumber.go): `math`
- [x] [0141-hasCycle](pkg/links/hasCycle.go): `link`
- [x] [0142-detectCycle](pkg/links/detectCycle.go): `link`
- [x] [0143-reorderList](pkg/links/reorderList.go): `link`
- [x] [0144-preOrderTraversal](pkg/trees/preOrderTraversal.go): `tree`, `loop`, `stack`
- [x] [0146-lruCache](pkg/links/lruCache.go): `link`, `cache`, `lru`
- [x] [0151-reverseWords](pkg/strings/reverseWords.go): `string`
- [x] [0152-maxProduct](pkg/arrays/maxProduct.go): `array`
- [x] [0167-towSumII](pkg/arrays/towSumII.go): `array`
- [x] [0169-majorityElement](pkg/arrays/majorityElement.go): `math`, `array`
- [x] [0174-calculateMinimumHP](pkg/matrix/calculateMinimumHP.go): `matrix`, `dp`
- [x] [0190-reverseBits](pkg/math/reverseBits.go): `bit`
- [x] [0198-rob](pkg/arrays/rob.go): `array`, `dp`
- [x] [0199-rightSideView](pkg/trees/rightSideView.go): `tree`, `bfs`
- [x] [0200-numIslands](pkg/matrix/numIslands.go): `matrix`, `land`
- [x] [0202-isHappy](pkg/math/isHappy.go): `number`, `math`
- [x] [0206-reverseList](pkg/links/reverseList.go): `reverse`, `link`
- [x] [0207-canFinish](pkg/graph/canFinish.go): `graph`
- [x] [0209-minSubArrayLen](pkg/arrays/minSubArrayLen.go): `array`
- [x] [0210-findOrder](pkg/arrays/findOrder.go): `array`, `topological-sort`
- [x] [0215-findKthLargest](pkg/arrays/findKthLargest.go): `array`, `heap`
- [x] [0217-containsDuplicate](pkg/arrays/containsDuplicate.go): `array`, `duplicate`
- [x] [0224-calculate](pkg/math/calculate.go): `string`, `calculate`
- [x] [0236-lowestCommonAncestor](pkg/trees/lowestCommonAncestor.go): `tree`, `bfs`, `dfs`
- [x] [0238-productExceptSelf](pkg/arrays/productExceptSelf.go): `array`, `math`
- [x] [0287-findDuplicate](pkg/arrays/findDuplicate.go): `array`, `duplicate`
- [x] [0289-gameOfLife](pkg/matrix/gameOfLife.go): `matrix`
- [x] [0300-lengthOfLIS](pkg/arrays/lengthOfLIS.go): `array`
- [x] [0309-maxProfitWithCooldown](pkg/arrays/maxProfitWithCooldown.go): `array`, `dp`
- [x] [0312-maxCoins](pkg/arrays/maxCoins.go): `array`, `dp`
- [x] [0315-countSmaller](pkg/arrays/countSmaller.go): `array`, `sort`
- [x] [0322-coinChange](pkg/math/coinChange.go): `math`
- [x] [0332-FindItinerary](pkg/matrix/findItinerary.go): `matrix`, `dfs`
- [x] [0336-palindromePairs](pkg/strings/palindromePairs.go): `string`, `map`
- [x] [0337-rob](pkg/trees/rob.go): `tree`, `dfs`
- [x] [0350-intersect](pkg/arrays/intersect.go): `array`, `map`
- [x] [0355-twtter](pkg/stacks/twtter.go): `twtter`
- [x] [0365-canMeasureWater](pkg/math/canMeasureWater.go): `math`, `gcd`
- [x] [0378-kthSmallest](pkg/matrix/kthSmallest.go): `matrix`
- [x] [0392-IsSubsequence](pkg/strings/isSubsequence.go): `string`
- [x] [0409-longestPalindrome](pkg/strings/longestPalindrome.go): `string`, `palindrome`
- [x] [0410-splitArray](pkg/arrays/splitArray.go): `array`, `dp`
- [x] [0415-addStrings](pkg/strings/addStrings.go): `string`, `add`
- [x] [0445-addTowNumberII](pkg/links/addTwoNumbersII.go): `link`, `add`
- [x] [0466-getMaxRepetitions](pkg/strings/getMaxRepetitions.go): `string`
- [x] [0460-lfuCache](pkg/links/lfuCache.go): `cache`, `map`, `link`, `lfu`
- [x] [0486-predictTheWinner](pkg/arrays/predictTheWinner.go): `array`, `dp`
- [x] [0529-updateBoard](pkg/matrix/updateBoard.go): `matrix`, `dfs`
- [x] [0542-updateMatrix](pkg/matrix/updateMatrix.go): `matrix`, `dp`
- [x] [0543-diameterOfBinaryTree](pkg/trees/diameterOfBinaryTree.go): `array`, `dfs`
- [x] [0546-removeBoxes](pkg/arrays/removeBoxes.go): `array`, `dp`
- [x] [0557-reverseWordsIII](pkg/strings/reverseWordsIII.go): `string`
- [x] [0560-subArraySum](pkg/arrays/subArraySum.go): `array`
- [x] [0572-isSubtree](pkg/trees/isSubtree.go): `tree`, `dfs`
- [x] [0632-smallestRange](pkg/arrays/smallestRange.go): `array`, `heap`
- [x] [0680-validPalindrome](pkg/strings/validPalindrome.go): `string`
- [x] [0695-maxAreaOfIsland](pkg/matrix/maxAreaOfIsland.go): `matrix`, `dfs`
- [x] [0696-countBinarySubstrings](pkg/strings/countBinarySubstrings.go): `string`
- [x] [0739-dailyTemperatures](pkg/arrays/dailyTemperatures.go): `array`
- [x] [0766-isToeplitzMatrix](pkg/matrix/isToeplitzMatrix.go): `matrix`
- [x] [0785-isBipartite](pkg/matrix/isBipartite.go): `matrix`
- [x] [0820-minimumLengthEncoding](pkg/strings/minimumLengthEncoding.go): `array`, `encode`
- [x] [0832-flipAndInvertImage](pkg/matrix/flipAndInvertImage.go): `matrix`
- [x] [0836-isRectangleOverlap](pkg/matrix/isRectangleOverlap.go): `matrix`, `overlap`
- [x] [0837-new21Game](pkg/math/new21Game.go): `dp`
- [x] [0841-canVisitAllRooms](pkg/matrix/canVisitAllRooms.go): `bfs`
- [x] [0876-middleMode](pkg/links/middleNode.go): `middle`, `link`, `ptr`
- [x] [0887-superEggDrop](pkg/math/superEggDrop.go): `math`, `dp`
- [x] [0892-surfaceArea](pkg/matrix/surfaceArea.go): `matrix`, `area`
- [x] [0912-sortArray](pkg/arrays/sortArray.go): `array`, `quick`, `sort`
- [x] [0914-hasGroupsSizeX](pkg/arrays/hasGroupsSizeX.go): `array`, `group`, `gcd`
- [x] [0945-minIncrementForUnique](pkg/arrays/minIncrementForUnique.go): `sum`, `array`
- [x] [0983-mincostTickets](pkg/arrays/mincostTickets.go): `array`, `dp`
- [x] [0990-equationsPossible](pkg/arrays/equationsPossible.go): `array`, `string`
- [x] [0994-orangesRotting](pkg/matrix/orangesRotting.go): `matrix`, `bfs`
- [x] [0999-numRookCaptures](pkg/matrix/numRookCaptures.go): `matrix`
- [x] [1004-longestOnes](pkg/arrays/longestOnes.go): `array`, `sliding-window`
- [x] [1013-canThreePartsEqualSum](pkg/arrays/canThreePartsEqualSum.go): `array`, `ptr`
- [x] [1014-maxScoreSightseeingPair](pkg/arrays/maxScoreSightseeingPair.go): `array`, `dp`
- [x] [1028-recoverFromPreorder](pkg/trees/recoverFromPreorder.go): `tree`, ``
- [x] [1095-findInMountainArray](pkg/arrays/findInMountainArray.go): `array`, `binary-search`
- [x] [1103-distributeCandies](pkg/math/distributeCandies.go): `math`, `arithmetic-progression`
- [x] [1111-maxDepthAfterSplit](pkg/strings/maxDepthAfterSplit.go): `string`
- [x] [1160-countCharacters](pkg/strings/countCharacters.go): `string`
- [x] [1162-maxDistance](pkg/matrix/maxDistance.go): `matrix`, `bfs`
- [x] [1248-numberOfSubarrays](pkg/arrays/numberOfSubarrays.go): `array`
- [x] [1371-findTheLongestSubstring](pkg/strings/findTheLongestSubstring.go): `string`
- [x] [1431-kidsWithCandies](pkg/arrays/kidsWithCandies.go): `array`
- [x] [面试题-01.06-compressString](pkg/strings/compressString.go): `string`, `compress`
- [x] [面试题-01.07-rotate](pkg/matrix/rotate.go): `rotate`, `matrix`
- [x] [面试题-02.01-removeDuplicateNodes](pkg/links/removeDuplicateNodes.go): `link`
- [x] [面试题-08.11-waysToChange](pkg/math/waysToChange.go): `math`
- [x] [面试题-10.01-sortedMerge](pkg/arrays/merge.go): `array`, `index`
- [x] [面试题-13-movingCount](pkg/matrix/movingCount.go): `dp`
- [x] [面试题-16.03-intersection](pkg/math/intersection.go): `math`
- [x] [面试题-16.11-divingBoard](pkg/math/divingBoard.go): `math`
- [x] [面试题-16.18-patternMatching](pkg/strings/patternMatching.go): `string`
- [x] [面试题-17.13-respace](pkg/strings/respace.go): `string`
- [x] [面试题-17.16-massage](pkg/arrays/massage.go): `array`, `sum`
- [x] [面试题-29-spiralOrder](pkg/matrix/spiralOrder.go): `matrix`
- [x] [面试题-40-getLeastNumbers](pkg/arrays/getLeastNumbers.go): `array`
- [x] [面试题-46-translateNum](pkg/math/translateNum.go): `number`, `backtracking`
- [x] [面试题-51-reversePairs](pkg/arrays/reversePairs.go): `array`
- [x] [面试题-56-singleNumbers](pkg/math/singleNumbers.go): `number`, `math`, `bit`
- [x] [面试题-57-II-findContinuousSequence](pkg/math/findContinuousSequence.go): `arithmetic-progression`
- [x] [面试题-59-II-maxQueue](pkg/stacks/maxQueue.go): `link`, `stack`
- [x] [面试题-62-lastRemaining](pkg/math/lastRemaining.go): `math`
- [x] [面试题-64-sumNums](pkg/math/sumNums.go): `math`