Repository: haoel/leetcode Branch: master Commit: 125c4d8d7e3a Files: 730 Total size: 1.6 MB Directory structure: gitextract_9q_nrc1i/ ├── .gitignore ├── README.md ├── algorithms/ │ ├── cpp/ │ │ ├── 3Sum/ │ │ │ └── 3Sum.cpp │ │ ├── 3SumClosest/ │ │ │ └── 3SumClosest.cpp │ │ ├── 4Sum/ │ │ │ └── 4Sum.cpp │ │ ├── FindValidMatrixGivenRowAndColumnSums/ │ │ │ └── FindValidMatrixGivenRowAndColumnSums.cpp │ │ ├── LRUCache/ │ │ │ └── LRUCache.cpp │ │ ├── NumberOfWaysToSplitString/ │ │ │ └── NumberOfWaysToSplitString.cpp │ │ ├── UTF8Validation/ │ │ │ └── UTF8Validation.cpp │ │ ├── accountsMerge/ │ │ │ └── AccountsMerge.cpp │ │ ├── addAndSearchWord/ │ │ │ └── AddAndSearchWord.cpp │ │ ├── addBinary/ │ │ │ └── addBinary.cpp │ │ ├── addDigits/ │ │ │ └── addDigits.cpp │ │ ├── addStrings/ │ │ │ └── AddStrings.cpp │ │ ├── addToArrayFormOfInteger/ │ │ │ └── AddToArrayFormOfInteger.cpp │ │ ├── addTwoNumbers/ │ │ │ └── addTwoNumbers.cpp │ │ ├── additiveNumber/ │ │ │ └── AdditiveNumber.cpp │ │ ├── anagrams/ │ │ │ ├── GroupAnagrams.cpp │ │ │ └── ValidAnagram.cpp │ │ ├── arithmeticSlices/ │ │ │ └── ArithmeticSlices.cpp │ │ ├── backspaceStringCompare/ │ │ │ └── BackspaceStringCompare.cpp │ │ ├── balancedBinaryTree/ │ │ │ └── balancedBinaryTree.cpp │ │ ├── basicCalculator/ │ │ │ ├── BasicCalculator.II.cpp │ │ │ └── BasicCalculator.cpp │ │ ├── bestTimeToBuyAndSellStock/ │ │ │ ├── BestTimeToBuyAndSellStockWithCooldown.cpp │ │ │ ├── BestTimeToBuyAndSellStockWithTransactionFee.cpp │ │ │ ├── bestTimeToBuyAndSellStock.II.cpp │ │ │ ├── bestTimeToBuyAndSellStock.III.cpp │ │ │ ├── bestTimeToBuyAndSellStock.IV.cpp │ │ │ └── bestTimeToBuyAndSellStock.cpp │ │ ├── binarySearchTreeIterator/ │ │ │ └── binarySearchTreeIterator.cpp │ │ ├── binaryTreeInorderTraversal/ │ │ │ └── binaryTreeInorderTraversal.cpp │ │ ├── binaryTreeLevelOrderTraversal/ │ │ │ ├── binaryTreeLevelOrderTraversal.II.cpp │ │ │ └── binaryTreeLevelOrderTraversal.cpp │ │ ├── binaryTreeMaximumPathSum/ │ │ │ └── binaryTreeMaximumPathSum.cpp │ │ ├── binaryTreePaths/ │ │ │ └── binaryTreePaths.cpp │ │ ├── binaryTreePostorderTraversal/ │ │ │ └── binaryTreePostorderTraversal.cpp │ │ ├── binaryTreePreorderTraversal/ │ │ │ └── binaryTreePreorderTraversal.cpp │ │ ├── binaryTreeRightSideView/ │ │ │ └── binaryTreeRightSideView.cpp │ │ ├── binaryTreeUpsideDown/ │ │ │ └── binaryTreeUpsideDown.cpp │ │ ├── binaryTreeZigzagLevelOrderTraversal/ │ │ │ └── binaryTreeZigzagLevelOrderTraversal.cpp │ │ ├── binaryWatch/ │ │ │ └── BinaryWatch.cpp │ │ ├── bitwiseANDOfNumbersRange/ │ │ │ └── BitwiseAndOfNumbersRange.cpp │ │ ├── brokenCalculator/ │ │ │ └── BrokenCalculator.cpp │ │ ├── buddyStrings/ │ │ │ └── BuddyStrings.cpp │ │ ├── buildingBoxes/ │ │ │ └── BuildingBoxes.cpp │ │ ├── bulbSwitcher/ │ │ │ ├── BulbSwitcher.II.cpp │ │ │ ├── BulbSwitcher.III.cpp │ │ │ ├── BulbSwitcher.IV.cpp │ │ │ └── bulbSwitcher.cpp │ │ ├── bullsAndCows/ │ │ │ └── bullsAndCows.cpp │ │ ├── burstBalloons/ │ │ │ └── BurstBalloons.cpp │ │ ├── calculateMoneyInLeetcodeBank/ │ │ │ └── CalculateMoneyInLeetcodeBank.cpp │ │ ├── candy/ │ │ │ └── candy.cpp │ │ ├── checkIfArrayIsSortedAndRotated/ │ │ │ └── CheckIfArrayIsSortedAndRotated.cpp │ │ ├── checkIfBinaryStringHasAtMostOneSegmentOfOnes/ │ │ │ └── CheckIfBinaryStringHasAtMostOneSegmentOfOnes.cpp │ │ ├── checkIfNumberIsASumOfPowersOfThree/ │ │ │ └── CheckIfNumberIsASumOfPowersOfThree.cpp │ │ ├── checkIfOneStringSwapCanMakeStringsEqual/ │ │ │ └── CheckIfOneStringSwapCanMakeStringsEqual.cpp │ │ ├── checkIfTheSentenceIsPangram/ │ │ │ └── CheckIfTheSentenceIsPangram.cpp │ │ ├── checkIfWordEqualsSummationOfTwoWords/ │ │ │ └── CheckIfWordEqualsSummationOfTwoWords.cpp │ │ ├── climbStairs/ │ │ │ └── climbStairs.cpp │ │ ├── cloneGraph/ │ │ │ └── cloneGraph.cpp │ │ ├── closestDessertCost/ │ │ │ └── ClosestDessertCost.cpp │ │ ├── closestRoom/ │ │ │ └── ClosestRoom.cpp │ │ ├── closestSubsequenceSum/ │ │ │ └── ClosestSubsequenceSum.cpp │ │ ├── coinChange/ │ │ │ ├── CoinChange2.cpp │ │ │ └── coinChange.cpp │ │ ├── combinationSum/ │ │ │ ├── combinationSum.II.cpp │ │ │ ├── combinationSum.III.cpp │ │ │ └── combinationSum.cpp │ │ ├── combinationSumIV/ │ │ │ └── combinationSumIV.cpp │ │ ├── combinations/ │ │ │ └── combinations.cpp │ │ ├── compareStringsByFrequencyOfTheSmallestCharacter/ │ │ │ └── CompareStringsByFrequencyOfTheSmallestCharacter.cpp │ │ ├── compareVersionNumbers/ │ │ │ └── compareVersionNumbers.cpp │ │ ├── constructBinaryTreeFromInorderAndPostorderTraversal/ │ │ │ └── constructBinaryTreeFromInorderAndPostorderTraversal.cpp │ │ ├── constructBinaryTreeFromPreorderAndInorderTraversal/ │ │ │ └── constructBinaryTreeFromPreorderAndInorderTraversal.cpp │ │ ├── constructTheLexicographicallyLargestValidSequence/ │ │ │ └── ConstructTheLexicographicallyLargestValidSequence.cpp │ │ ├── containerWithMostWater/ │ │ │ └── containerWithMostWater.cpp │ │ ├── containsDuplicate/ │ │ │ ├── ContainsDuplicate.II.cpp │ │ │ ├── ContainsDuplicate.III.cpp │ │ │ └── ContainsDuplicate.cpp │ │ ├── convertANumberToHexadecimal/ │ │ │ └── ConvertANumberToHexadecimal.cpp │ │ ├── convertSortedArrayToBinarySearchTree/ │ │ │ └── convertSortedArrayToBinarySearchTree.cpp │ │ ├── convertSortedListToBinarySearchTree/ │ │ │ └── convertSortedListToBinarySearchTree.cpp │ │ ├── copyListWithRandomPointer/ │ │ │ └── copyListWithRandomPointer.cpp │ │ ├── countAndSay/ │ │ │ └── countAndSay.cpp │ │ ├── countCompleteTreeNodes/ │ │ │ └── CountCompleteTreeNodes.cpp │ │ ├── countGoodMeals/ │ │ │ └── CountGoodMeals.cpp │ │ ├── countItemsMatchingARule/ │ │ │ └── CountItemsMatchingARule.cpp │ │ ├── countNicePairsInAnArray/ │ │ │ └── CountNicePairsInAnArray.cpp │ │ ├── countNumberOfHomogenousSubstrings/ │ │ │ └── CountNumberOfHomogenousSubstrings.cpp │ │ ├── countNumbersWithUniqueDigits/ │ │ │ └── CountNumbersWithUniqueDigits.cpp │ │ ├── countOddNumbersInAnIntervalRange/ │ │ │ └── CountOddNumbersInAnIntervalRange.cpp │ │ ├── countOfRangeSum/ │ │ │ └── CountOfRangeSum.cpp │ │ ├── countOfSmallerNumbersAfterSelf/ │ │ │ └── countOfSmallerNumbersAfterSelf.cpp │ │ ├── countPairsOfNodes/ │ │ │ └── CountPairsOfNodes.cpp │ │ ├── countPairsWithXorInARange/ │ │ │ └── CountPairsWithXorInARange.cpp │ │ ├── countPrimes/ │ │ │ └── CountPrimes.cpp │ │ ├── countingBits/ │ │ │ └── CountingBits.cpp │ │ ├── courseSchedule/ │ │ │ ├── CourseSchedule.II.cpp │ │ │ ├── CourseSchedule.cpp │ │ │ └── non-recursive/ │ │ │ ├── course_schedule.cpp │ │ │ └── main.cpp │ │ ├── cousinsInBinaryTree/ │ │ │ └── CousinsInBinaryTree.cpp │ │ ├── createMaximumNumber/ │ │ │ └── CreateMaximumNumber.cpp │ │ ├── decodeString/ │ │ │ └── DecodeString.cpp │ │ ├── decodeWays/ │ │ │ └── decodeWays.cpp │ │ ├── decodeXORedPermutation/ │ │ │ └── DecodeXoredPermutation.cpp │ │ ├── deleteNodeInALinkedList/ │ │ │ └── DeleteNodeInALinkedList.cpp │ │ ├── designAuthenticationManager/ │ │ │ └── DesignAuthenticationManager.cpp │ │ ├── detectCapital/ │ │ │ └── DetectCapital.cpp │ │ ├── determineColorOfAChessboardSquare/ │ │ │ └── DetermineColorOfAChessboardSquare.cpp │ │ ├── diameterOfBinaryTree/ │ │ │ └── diameterOfBinaryTree.cpp │ │ ├── differentWaysToAddParentheses/ │ │ │ └── DifferentWaysToAddParentheses.cpp │ │ ├── distinctSubsequences/ │ │ │ └── distinctSubsequences.cpp │ │ ├── distributeCoinsInBinaryTree/ │ │ │ └── DistributeCoinsInBinaryTree.cpp │ │ ├── divideTwoInt/ │ │ │ └── divideTwoInt.cpp │ │ ├── dungeonGame/ │ │ │ └── dungeonGame.cpp │ │ ├── editDistance/ │ │ │ └── editDistance.cpp │ │ ├── eggDropWith2EggsAndNFloors/ │ │ │ └── EggDropWith2EggsAndNFloors.cpp │ │ ├── eliminationGame/ │ │ │ └── EliminationGame.cpp │ │ ├── equalSumArraysWithMinimumNumberOfOperations/ │ │ │ └── EqualSumArraysWithMinimumNumberOfOperations.cpp │ │ ├── evaluateDivision/ │ │ │ └── EvaluateDivision.cpp │ │ ├── evaluateReversePolishNotation/ │ │ │ └── evaluateReversePolishNotation.cpp │ │ ├── evaluateTheBracketPairsOfAString/ │ │ │ └── EvaluateTheBracketPairsOfAString.cpp │ │ ├── excelSheetColumnNumber/ │ │ │ └── excelSheetColumnNumber.cpp │ │ ├── excelSheetColumnTitle/ │ │ │ └── excelSheetColumnTitle.cpp │ │ ├── expressionAddOperators/ │ │ │ └── ExpressionAddOperators.cpp │ │ ├── factorialTrailingZeroes/ │ │ │ └── factorialTrailingZeroes.cpp │ │ ├── fibonacciNumber/ │ │ │ └── FibonacciNumber.cpp │ │ ├── filterRestaurantsByVeganFriendlyPriceAndDistance/ │ │ │ └── FilterRestaurantsByVeganFriendlyPriceAndDistance.cpp │ │ ├── findAllAnagramsInAString/ │ │ │ └── Find-All-Anagrams-in-a-String.cpp │ │ ├── findCenterOfStarGraph/ │ │ │ └── FindCenterOfStarGraph.cpp │ │ ├── findKthLargestXorCoordinateValue/ │ │ │ └── FindKthLargestXorCoordinateValue.cpp │ │ ├── findMedianFromDataStream/ │ │ │ └── FindMedianFromDataStream.cpp │ │ ├── findMinimumInRotatedSortedArray/ │ │ │ ├── findMinimumInRotatedSortedArray.II.cpp │ │ │ └── findMinimumInRotatedSortedArray.cpp │ │ ├── findNearestPointThatHasTheSameXOrYCoordinate/ │ │ │ └── FindNearestPointThatHasTheSameXOrYCoordinate.cpp │ │ ├── findPeakElement/ │ │ │ └── findPeakElement.cpp │ │ ├── findTheDifference/ │ │ │ └── FindTheDifference.cpp │ │ ├── findTheDuplicateNumber/ │ │ │ └── findTheDuplicateNumber.cpp │ │ ├── findTheHighestAltitude/ │ │ │ └── FindTheHighestAltitude.cpp │ │ ├── findTheWinnerOfAnArrayGame/ │ │ │ └── FindTheWinnerOfAnArrayGame.cpp │ │ ├── findTheWinnerOfTheCircularGame/ │ │ │ └── FindTheWinnerOfTheCircularGame.cpp │ │ ├── findXorSumOfAllPairsBitwiseAnd/ │ │ │ └── FindXorSumOfAllPairsBitwiseAnd.cpp │ │ ├── findingMkAverage/ │ │ │ └── FindingMkAverage.cpp │ │ ├── findingTheUsersActiveMinutes/ │ │ │ └── FindingTheUsersActiveMinutes.cpp │ │ ├── firstBadVersion/ │ │ │ └── FirstBadVersion.cpp │ │ ├── firstMissingPositive/ │ │ │ └── firstMissingPositive.cpp │ │ ├── firstUniqueCharacterInAString/ │ │ │ └── FirstUniqueCharacterInAString.cpp │ │ ├── fizzBuzz/ │ │ │ └── FizzBuzz.cpp │ │ ├── flattenBinaryTreeToLinkedList/ │ │ │ └── flattenBinaryTreeToLinkedList.cpp │ │ ├── flattenNestedListIterator/ │ │ │ └── FlattenNestedListIterator.cpp │ │ ├── formArrayByConcatenatingSubarraysOfAnotherArray/ │ │ │ └── FormArrayByConcatenatingSubarraysOfAnotherArray.cpp │ │ ├── fractionToRecurringDecimal/ │ │ │ └── fractionToRecurringDecimal.cpp │ │ ├── frequencyOfTheMostFrequentElement/ │ │ │ └── FrequencyOfTheMostFrequentElement.cpp │ │ ├── friendCircles/ │ │ │ └── FriendCircles.cpp │ │ ├── frogJump/ │ │ │ └── FrogJump.cpp │ │ ├── gameOfLife/ │ │ │ └── GameOfLife.cpp │ │ ├── gasStation/ │ │ │ └── gasStation.cpp │ │ ├── generateParentheses/ │ │ │ └── generateParentheses.cpp │ │ ├── grayCode/ │ │ │ └── grayCode.cpp │ │ ├── greatestCommonDivisorOfStrings/ │ │ │ └── GreatestCommonDivisorOfStrings.cpp │ │ ├── h-Index/ │ │ │ ├── h-Index.II.cpp │ │ │ └── h-Index.cpp │ │ ├── happyNumber/ │ │ │ └── HappyNumber.cpp │ │ ├── houseRobber/ │ │ │ ├── houseRobber.II.cpp │ │ │ ├── houseRobber.cpp │ │ │ └── houseRobberIII.cpp │ │ ├── implementQueueUsingStacks/ │ │ │ └── ImplementQueueUsingStacks.cpp │ │ ├── implementStackUsingQueues/ │ │ │ └── ImplementStackUsingQueues.cpp │ │ ├── implementTriePrefixTree/ │ │ │ └── ImplementTriePrefixTree.cpp │ │ ├── increasingTripletSubsequence/ │ │ │ └── increasingTripletSubsequence.cpp │ │ ├── incrementalMemoryLeak/ │ │ │ └── IncrementalMemoryLeak.cpp │ │ ├── insertDeleteGetRandom/ │ │ │ ├── InsertDeleteGetrandomO1.cpp │ │ │ └── InsertDeleteGetrandomO1DuplicatesAllowed.cpp │ │ ├── insertInterval/ │ │ │ └── insertInterval.cpp │ │ ├── insertionSortList/ │ │ │ └── insertionSortList.cpp │ │ ├── integerBreak/ │ │ │ └── IntegerBreak.cpp │ │ ├── integerReplacement/ │ │ │ └── IntegerReplacement.cpp │ │ ├── integerToEnglishWords/ │ │ │ └── IntegerToEnglishWords.cpp │ │ ├── integerToRoman/ │ │ │ └── integerToRoman.cpp │ │ ├── interleavingString/ │ │ │ └── interleavingString.cpp │ │ ├── intersectionOfTwoArrays/ │ │ │ ├── intersectionOfTwoArrays.cpp │ │ │ └── intersectionOfTwoArraysII.cpp │ │ ├── intersectionOfTwoLinkedLists/ │ │ │ └── intersectionOfTwoLinkedLists.cpp │ │ ├── intervalListIntersectons/ │ │ │ └── IntervalListIntersections.cpp │ │ ├── invertBinaryTree/ │ │ │ └── InvertBinaryTree.cpp │ │ ├── isSubsequence/ │ │ │ └── IsSubsequence.cpp │ │ ├── islandPerimeter/ │ │ │ └── IslandPerimeter.cpp │ │ ├── isomorphicStrings/ │ │ │ └── IsomorphicStrings.cpp │ │ ├── jewelsAndStones/ │ │ │ └── JewelsAndStones.cpp │ │ ├── jumpGame/ │ │ │ ├── jumpGame.II.cpp │ │ │ ├── jumpGame.VII.cpp │ │ │ └── jumpGame.cpp │ │ ├── kthLargestElementInAnArray/ │ │ │ └── KthLargestElementInAnArray.cpp │ │ ├── kthSmallestElementInaBST/ │ │ │ └── KthSmallestElementInABst.cpp │ │ ├── largestColorValueInADirectedGraph/ │ │ │ └── LargestColorValueInADirectedGraph.cpp │ │ ├── largestMergeOfTwoStrings/ │ │ │ └── LargestMergeOfTwoStrings.cpp │ │ ├── largestNumber/ │ │ │ └── largestNumber.cpp │ │ ├── largestNumberAfterMutatingSubstring/ │ │ │ └── LargestNumberAfterMutatingSubstring.cpp │ │ ├── largestPerimeterTriangle/ │ │ │ └── largestPerimeterTriangle.cpp │ │ ├── largestRectangleInHistogram/ │ │ │ └── largestRectangleInHistogram.cpp │ │ ├── largestSubmatrixWithRearrangements/ │ │ │ └── LargestSubmatrixWithRearrangements.cpp │ │ ├── largestSubstringBetweenTwoEqualCharacters/ │ │ │ └── LargestSubstringBetweenTwoEqualCharacters.cpp │ │ ├── latestTimeByReplacingHiddenDigits/ │ │ │ └── LatestTimeByReplacingHiddenDigits.cpp │ │ ├── lengthOfLastWord/ │ │ │ └── lengthOfLastWord.cpp │ │ ├── letterCombinationsOfAPhoneNumber/ │ │ │ └── letterCombinationsOfAPhoneNumber.cpp │ │ ├── lexicographicalNumbers/ │ │ │ └── LexicographicalNumbers.cpp │ │ ├── lexicographicallySmallestStringAfterApplyingOperations/ │ │ │ └── LexicographicallySmallestStringAfterApplyingOperations.cpp │ │ ├── linkedListCycle/ │ │ │ ├── linkedListCycle.II.cpp │ │ │ └── linkedListCycle.cpp │ │ ├── linkedListRandomNode/ │ │ │ └── LinkedListRandomNode.cpp │ │ ├── longerContiguousSegmentsOfOnesThanZeros/ │ │ │ └── LongerContiguousSegmentsOfOnesThanZeros.cpp │ │ ├── longestAbsoluteFilePath/ │ │ │ └── LongestAbsoluteFilePath.cpp │ │ ├── longestCommonPrefix/ │ │ │ └── longestCommonPrefix.cpp │ │ ├── longestConsecutiveSequence/ │ │ │ └── longestConsecutiveSequence.cpp │ │ ├── longestIncreasingPathInAMatrix/ │ │ │ └── LongestIncreasingPathInAMatrix.cpp │ │ ├── longestIncreasingSubsequence/ │ │ │ └── longestIncreasingSubsequence.cpp │ │ ├── longestNiceSubstring/ │ │ │ └── LongestNiceSubstring.cpp │ │ ├── longestPalindrome/ │ │ │ └── LongestPalindrome.cpp │ │ ├── longestPalindromicSubsequence/ │ │ │ └── LongestPalindromicSubsequence.cpp │ │ ├── longestPalindromicSubstring/ │ │ │ └── longestPalindromicSubstring.cpp │ │ ├── longestSubstringOfAllVowelsInOrder/ │ │ │ └── LongestSubstringOfAllVowelsInOrder.cpp │ │ ├── longestSubstringWithAtLeastKRepeatingCharacters/ │ │ │ └── LongestSubstringWithAtLeastKRepeatingCharacters.cpp │ │ ├── longestSubstringWithAtMostTwoDistinctCharacters/ │ │ │ └── longestSubstringWithAtMostTwoDistinctCharacters.cpp │ │ ├── longestSubstringWithoutRepeatingCharacters/ │ │ │ └── longestSubstringWithoutRepeatingCharacters.cpp │ │ ├── longestTurbulentSubarray/ │ │ │ └── LongestTurbulentSubarray.cpp │ │ ├── longestValidParentheses/ │ │ │ └── longestValidParentheses.cpp │ │ ├── lowestCommonAncestorOfABinarySearchTree/ │ │ │ └── LowestCommonAncestorOfABinarySearchTree.cpp │ │ ├── lowestCommonAncestorOfABinaryTree/ │ │ │ └── LowestCommonAncestorOfABinaryTree.cpp │ │ ├── majorityElement/ │ │ │ ├── majorityElement.II.cpp │ │ │ └── majorityElement.cpp │ │ ├── makeTheXorOfAllSegmentsEqualToZero/ │ │ │ └── MakeTheXorOfAllSegmentsEqualToZero.cpp │ │ ├── mapOfHighestPeak/ │ │ │ └── MapOfHighestPeak.cpp │ │ ├── matrixCellsInDistanceOrder/ │ │ │ └── MatrixCellsInDistanceOrder.cpp │ │ ├── maxAreaOfIsland/ │ │ │ └── MaxAreaOfIsland.cpp │ │ ├── maxPointsOnALine/ │ │ │ └── maxPointsOnALine.cpp │ │ ├── maximalRectangle/ │ │ │ └── maximalRectangle.cpp │ │ ├── maximalSquare/ │ │ │ └── MaximalSquare.cpp │ │ ├── maximizeNumberOfNiceDivisors/ │ │ │ └── MaximizeNumberOfNiceDivisors.cpp │ │ ├── maximizePalindromeLengthFromSubsequences/ │ │ │ └── MaximizePalindromeLengthFromSubsequences.cpp │ │ ├── maximizeScoreAfterNOperations/ │ │ │ └── MaximizeScoreAfterNOperations.cpp │ │ ├── maximumAbsoluteSumOfAnySubarray/ │ │ │ └── MaximumAbsoluteSumOfAnySubarray.cpp │ │ ├── maximumAscendingSubarraySum/ │ │ │ └── MaximumAscendingSubarraySum.cpp │ │ ├── maximumAveragePassRatio/ │ │ │ └── MaximumAveragePassRatio.cpp │ │ ├── maximumAverageSubarray/ │ │ │ └── MaximumAverageSubarray.I.cpp │ │ ├── maximumBuildingHeight/ │ │ │ └── MaximumBuildingHeight.cpp │ │ ├── maximumDepthOfBinaryTree/ │ │ │ └── maximumDepthOfBinaryTree.cpp │ │ ├── maximumDistanceBetweenAPairOfValues/ │ │ │ └── MaximumDistanceBetweenAPairOfValues.cpp │ │ ├── maximumElementAfterDecreasingAndRearranging/ │ │ │ └── MaximumElementAfterDecreasingAndRearranging.cpp │ │ ├── maximumErasureValue/ │ │ │ └── MaximumErasureValue.cpp │ │ ├── maximumGap/ │ │ │ └── maximumGap.cpp │ │ ├── maximumIceCreamBars/ │ │ │ └── MaximumIceCreamBars.cpp │ │ ├── maximumNumberOfBallsInABox/ │ │ │ └── MaximumNumberOfBallsInABox.cpp │ │ ├── maximumNumberOfConsecutiveValuesYouCanMake/ │ │ │ └── MaximumNumberOfConsecutiveValuesYouCanMake.cpp │ │ ├── maximumNumberOfEventsThatCanBeAttended/ │ │ │ ├── MaximumNumberOfEventsThatCanBeAttended.II.cpp │ │ │ └── MaximumNumberOfEventsThatCanBeAttended.cpp │ │ ├── maximumNumberOfGroupsGettingFreshDonuts/ │ │ │ └── MaximumNumberOfGroupsGettingFreshDonuts.cpp │ │ ├── maximumNumberOfWordsYouCanType/ │ │ │ └── MaximumNumberOfWordsYouCanType.cpp │ │ ├── maximumPopulationYear/ │ │ │ └── MaximumPopulationYear.cpp │ │ ├── maximumProductOfTwoElementsInAnArray/ │ │ │ └── MaximumProductOfTwoElementsInAnArray.cpp │ │ ├── maximumProductOfWordLengths/ │ │ │ └── MaximumProductOfWordLengths.cpp │ │ ├── maximumProductSubarray/ │ │ │ └── maximumProductSubarray.cpp │ │ ├── maximumScoreFromPerformingMultiplicationOperations/ │ │ │ └── MaximumScoreFromPerformingMultiplicationOperations.cpp │ │ ├── maximumScoreFromRemovingStones/ │ │ │ └── MaximumScoreFromRemovingStones.cpp │ │ ├── maximumScoreFromRemovingSubstrings/ │ │ │ └── MaximumScoreFromRemovingSubstrings.cpp │ │ ├── maximumScoreOfAGoodSubarray/ │ │ │ └── MaximumScoreOfAGoodSubarray.cpp │ │ ├── maximumSubArray/ │ │ │ └── maximumSubArray.cpp │ │ ├── maximumSubarrayMinProduct/ │ │ │ └── MaximumSubarrayMinProduct.cpp │ │ ├── maximumUnitsOnATruck/ │ │ │ └── MaximumUnitsOnATruck.cpp │ │ ├── maximumValueAfterInsertion/ │ │ │ └── MaximumValueAfterInsertion.cpp │ │ ├── maximumValueAtAGivenIndexInABoundedArray/ │ │ │ └── MaximumValueAtAGivenIndexInABoundedArray.cpp │ │ ├── maximumXorForEachQuery/ │ │ │ └── MaximumXorForEachQuery.cpp │ │ ├── medianOfTwoSortedArrays/ │ │ │ └── medianOfTwoSortedArrays.cpp │ │ ├── mergeIntervals/ │ │ │ └── mergeIntervals.cpp │ │ ├── mergeKSortedLists/ │ │ │ └── mergeKSortedLists.cpp │ │ ├── mergeStringsAlternately/ │ │ │ └── MergeStringsAlternately.cpp │ │ ├── mergeTwoSortedArray/ │ │ │ └── mergeTwoSortedArray.cpp │ │ ├── mergeTwoSortedList/ │ │ │ └── mergeTwoSortedList.cpp │ │ ├── minCostClimbingStairs/ │ │ │ └── MinCostClimbingStairs.cpp │ │ ├── minStack/ │ │ │ └── minStack.cpp │ │ ├── miniParser/ │ │ │ └── MiniParser.cpp │ │ ├── minimizeMaximumPairSumInArray/ │ │ │ └── MinimizeMaximumPairSumInArray.cpp │ │ ├── minimumASCIIDeleteSumForTwoStrings/ │ │ │ └── MinimumAsciiDeleteSumForTwoStrings.cpp │ │ ├── minimumAbsoluteSumDifference/ │ │ │ └── MinimumAbsoluteSumDifference.cpp │ │ ├── minimumAdjacentSwapsToReachTheKthSmallestNumber/ │ │ │ └── MinimumAdjacentSwapsToReachTheKthSmallestNumber.cpp │ │ ├── minimumChangesToMakeAlternatingBinaryString/ │ │ │ └── MinimumChangesToMakeAlternatingBinaryString.cpp │ │ ├── minimumCostForTickets/ │ │ │ └── MinimumCostForTickets.cpp │ │ ├── minimumDegreeOfAConnectedTrioInAGraph/ │ │ │ └── MinimumDegreeOfAConnectedTrioInAGraph.cpp │ │ ├── minimumDepthOfBinaryTree/ │ │ │ └── minimumDepthOfBinaryTree.cpp │ │ ├── minimumDistanceToTheTargetElement/ │ │ │ └── MinimumDistanceToTheTargetElement.cpp │ │ ├── minimumElementsToAddToFormAGivenSum/ │ │ │ └── MinimumElementsToAddToFormAGivenSum.cpp │ │ ├── minimumFallingPathSum/ │ │ │ └── MinimumFallingPathSum.cpp │ │ ├── minimumHeightTrees/ │ │ │ └── MinimumHeightTrees.cpp │ │ ├── minimumInsertionsToBalanceAParenthesesString/ │ │ │ └── MinimumInsertionsToBalanceAParenthesesString.cpp │ │ ├── minimumIntervalToIncludeEachQuery/ │ │ │ └── MinimumIntervalToIncludeEachQuery.cpp │ │ ├── minimumLengthOfStringAfterDeletingSimilarEnds/ │ │ │ └── MinimumLengthOfStringAfterDeletingSimilarEnds.cpp │ │ ├── minimumLimitOfBallsInABag/ │ │ │ └── MinimumLimitOfBallsInABag.cpp │ │ ├── minimumNumberOfOperationsToMoveAllBallsToEachBox/ │ │ │ └── MinimumNumberOfOperationsToMoveAllBallsToEachBox.cpp │ │ ├── minimumNumberOfOperationsToReinitializeAPermutation/ │ │ │ └── MinimumNumberOfOperationsToReinitializeAPermutation.cpp │ │ ├── minimumNumberOfPeopleToTeach/ │ │ │ └── MinimumNumberOfPeopleToTeach.cpp │ │ ├── minimumOperationsToMakeArrayEqual/ │ │ │ └── MinimumOperationsToMakeArrayEqual.cpp │ │ ├── minimumOperationsToMakeTheArrayIncreasing/ │ │ │ └── MinimumOperationsToMakeTheArrayIncreasing.cpp │ │ ├── minimumPathSum/ │ │ │ └── minimumPathSum.cpp │ │ ├── minimumSidewayJumps/ │ │ │ └── MinimumSidewayJumps.cpp │ │ ├── minimumSizeSubarraySum/ │ │ │ └── MinimumSizeSubarraySum.cpp │ │ ├── minimumSpeedToArriveOnTime/ │ │ │ └── MinimumSpeedToArriveOnTime.cpp │ │ ├── minimumWindowSubstring/ │ │ │ └── minimumWindowSubstring.cpp │ │ ├── mirrorReflection/ │ │ │ └── MirrorReflection.cpp │ │ ├── missingNumber/ │ │ │ └── MissingNumber.cpp │ │ ├── missingRanges/ │ │ │ └── missingRanges.cpp │ │ ├── mostCommonWord/ │ │ │ └── MostCommonWord.cpp │ │ ├── moveZeroes/ │ │ │ └── moveZeroes.cpp │ │ ├── multiplyStrings/ │ │ │ └── multiplyStrings.cpp │ │ ├── nQueens/ │ │ │ ├── nQueuens.II.cpp │ │ │ └── nQueuens.cpp │ │ ├── nRepeatedElementInSize2NArray/ │ │ │ └── N-Repeated-Element-in-Size-2N-Array.cpp │ │ ├── nextPermutation/ │ │ │ └── nextPermutation.cpp │ │ ├── nimGame/ │ │ │ └── nimGame.cpp │ │ ├── nthDigit/ │ │ │ └── NthDigit.cpp │ │ ├── numberOf1Bits/ │ │ │ └── numberOf1Bits.cpp │ │ ├── numberOfDifferentIntegersInAString/ │ │ │ └── NumberOfDifferentIntegersInAString.cpp │ │ ├── numberOfDifferentSubsequencesGcds/ │ │ │ └── NumberOfDifferentSubsequencesGcds.cpp │ │ ├── numberOfDigitOne/ │ │ │ └── NumberOfDigitOne.cpp │ │ ├── numberOfGoodWaysToSplitAString/ │ │ │ └── NumberOfGoodWaysToSplitAString.cpp │ │ ├── numberOfIslands/ │ │ │ └── NumberOfIslands.cpp │ │ ├── numberOfOrdersInTheBacklog/ │ │ │ └── NumberOfOrdersInTheBacklog.cpp │ │ ├── numberOfRecentCalls/ │ │ │ └── NumberOfRecentCalls.cpp │ │ ├── numberOfRectanglesThatCanFormTheLargestSquare/ │ │ │ └── NumberOfRectanglesThatCanFormTheLargestSquare.cpp │ │ ├── numberOfRestrictedPathsFromFirstToLastNode/ │ │ │ └── NumberOfRestrictedPathsFromFirstToLastNode.cpp │ │ ├── numberOfStudentsUnableToEatLunch/ │ │ │ └── NumberOfStudentsUnableToEatLunch.cpp │ │ ├── numberOfSubArraysWithOddSum/ │ │ │ └── NumberOfSubArraysWithOddSum.cpp │ │ ├── numberOfSubstringsWithOnly1s/ │ │ │ └── NumberOfSubstringsWithOnly1s.cpp │ │ ├── oddEvenLinkedList/ │ │ │ └── OddEvenLinkedList.cpp │ │ ├── oneEditDistance/ │ │ │ └── oneEditDistance.cpp │ │ ├── palindromeLinkedList/ │ │ │ └── PalindromeLinkedList.cpp │ │ ├── palindromeNumber/ │ │ │ └── palindromeNumber.cpp │ │ ├── palindromePairs/ │ │ │ └── PalindromePairs.cpp │ │ ├── palindromePartitioning/ │ │ │ ├── palindromePartitioning.II.cpp │ │ │ └── palindromePartitioning.cpp │ │ ├── palindromicSubstrings/ │ │ │ └── PalindromicSubstrings.cpp │ │ ├── partitionEqualSubsetSum/ │ │ │ └── PartitionEqualSubsetSum.cpp │ │ ├── partitionList/ │ │ │ └── partitionList.cpp │ │ ├── pascalTriangle/ │ │ │ ├── pascalTriangle.II.cpp │ │ │ └── pascalTriangle.cpp │ │ ├── patchingArray/ │ │ │ └── PatchingArray.cpp │ │ ├── pathSum/ │ │ │ ├── pathSum.II.cpp │ │ │ └── pathSum.cpp │ │ ├── peakIndexInAMountainArray/ │ │ │ └── PeakIndexInAMountainArray.cpp │ │ ├── peekingIterator/ │ │ │ └── PeekingIterator.cpp │ │ ├── perfectRectangle/ │ │ │ └── PerfectRectangle.cpp │ │ ├── perfectSquares/ │ │ │ └── PerfectSquares.cpp │ │ ├── permutationSequence/ │ │ │ └── permutationSequence.cpp │ │ ├── permutations/ │ │ │ ├── permutations.II.cpp │ │ │ └── permutations.cpp │ │ ├── plusOne/ │ │ │ └── plusOne.cpp │ │ ├── populatingNextRightPointersInEachNode/ │ │ │ ├── populatingNextRightPointersInEachNode.II.cpp │ │ │ └── populatingNextRightPointersInEachNode.cpp │ │ ├── pow/ │ │ │ └── pow.cpp │ │ ├── powerOfFour/ │ │ │ └── PowerOfFour.cpp │ │ ├── powerOfThree/ │ │ │ └── PowerOfThree.cpp │ │ ├── powerOfTwo/ │ │ │ └── PowerOfTwo.cpp │ │ ├── processTasksUsingServers/ │ │ │ └── ProcessTasksUsingServers.cpp │ │ ├── productOfArrayExceptSelf/ │ │ │ └── ProductOfArrayExceptSelf.cpp │ │ ├── queriesOnNumberOfPointsInsideACircle/ │ │ │ └── QueriesOnNumberOfPointsInsideACircle.cpp │ │ ├── queueReconstructionByHeight/ │ │ │ └── QueueReconstructionByHeight.cpp │ │ ├── randomPickIndex/ │ │ │ └── RandomPickIndex.cpp │ │ ├── randomPointInNonOverlappingRectangles/ │ │ │ └── randomPointInNonOverlappingRectangles.cpp │ │ ├── rangeSumQuery-Immutable/ │ │ │ ├── rangeSumQuery-Immutable.cpp │ │ │ └── rangeSumQuery-Mutable/ │ │ │ └── RangeSumQueryMutable.cpp │ │ ├── rangeSumQuery2D-Immutable/ │ │ │ └── RangeSumQuery2dImmutable.cpp │ │ ├── ransomNote/ │ │ │ └── RansomNote.cpp │ │ ├── readNCharactersGivenRead4/ │ │ │ ├── readNCharactersGivenRead4.II.cpp │ │ │ └── readNCharactersGivenRead4.cpp │ │ ├── reconstructItinerary/ │ │ │ └── ReconstructItinerary.cpp │ │ ├── recoverATreeFromPreorderTraversal/ │ │ │ └── recoverATreeFromPreorderTraversal.cpp │ │ ├── recoverBinarySearchTree/ │ │ │ └── recoverBinarySearchTree.cpp │ │ ├── rectangleArea/ │ │ │ └── RectangleArea.cpp │ │ ├── reformatPhoneNumber/ │ │ │ └── ReformatPhoneNumber.cpp │ │ ├── regularExpressionMatching/ │ │ │ └── regularExpressionMatching.cpp │ │ ├── removeDuplicateLetters/ │ │ │ └── RemoveDuplicateLetters.cpp │ │ ├── removeDuplicatesFromSortedArray/ │ │ │ ├── removeDuplicatesFromSortedArray.II.cpp │ │ │ └── removeDuplicatesFromSortedArray.cpp │ │ ├── removeDuplicatesFromSortedList/ │ │ │ ├── removeDuplicatesFromSortedList.II.cpp │ │ │ └── removeDuplicatesFromSortedList.cpp │ │ ├── removeElement/ │ │ │ └── removeElement.cpp │ │ ├── removeInvalidParentheses/ │ │ │ └── RemoveInvalidParentheses.cpp │ │ ├── removeKDigits/ │ │ │ └── RemoveKDigits.cpp │ │ ├── removeLinkedListElements/ │ │ │ └── RemoveLinkedListElements.cpp │ │ ├── removeNthNodeFromEndOfList/ │ │ │ └── removeNthNodeFromEndOfList.cpp │ │ ├── reorderList/ │ │ │ └── reorderList.cpp │ │ ├── repeatedDNASequences/ │ │ │ └── repeatedDNASequences.cpp │ │ ├── replaceAllDigitsWithCharacters/ │ │ │ └── ReplaceAllDigitsWithCharacters.cpp │ │ ├── restoreIPAddresses/ │ │ │ └── restoreIPAddresses.cpp │ │ ├── restoreTheArrayFromAdjacentPairs/ │ │ │ └── RestoreTheArrayFromAdjacentPairs.cpp │ │ ├── reverseBits/ │ │ │ └── reverseBits.cpp │ │ ├── reverseInteger/ │ │ │ └── reverseInteger.cpp │ │ ├── reverseLinkedList/ │ │ │ ├── reverseLinkedList.II.cpp │ │ │ └── reverseLinkedList.cpp │ │ ├── reverseNodesInKGroup/ │ │ │ └── reverseNodesInKGroup.cpp │ │ ├── reverseString/ │ │ │ └── ReverseString.cpp │ │ ├── reverseVowelsOfAString/ │ │ │ └── reverseVowelsOfAString.cpp │ │ ├── reverseWordsInAString/ │ │ │ ├── reverseWordsInAString.II.cpp │ │ │ └── reverseWordsInAString.cpp │ │ ├── romanToInteger/ │ │ │ └── romanToInteger.cpp │ │ ├── rotateArray/ │ │ │ └── rotateArray.cpp │ │ ├── rotateFunction/ │ │ │ └── RotateFunction.cpp │ │ ├── rotateImage/ │ │ │ └── rotateImage.cpp │ │ ├── rotateList/ │ │ │ └── rotateList.cpp │ │ ├── rotatingTheBox/ │ │ │ └── RotatingTheBox.cpp │ │ ├── sameTree/ │ │ │ └── sameTree.cpp │ │ ├── satisfiabilityOfEqualityEquations/ │ │ │ └── SatisfiabilityOfEqualityEquations.cpp │ │ ├── scrambleString/ │ │ │ └── scrambleString.cpp │ │ ├── search2DMatrix/ │ │ │ ├── search2DMatrix.II.cpp │ │ │ └── search2DMatrix.cpp │ │ ├── searchForRange/ │ │ │ └── searchForRange.cpp │ │ ├── searchInRotatedSortedArray/ │ │ │ ├── searchInRotatedSortedArray.II.cpp │ │ │ └── searchInRotatedSortedArray.cpp │ │ ├── searchInsertPosition/ │ │ │ └── searchInsertPosition.cpp │ │ ├── seatReservationManager/ │ │ │ └── SeatReservationManager.cpp │ │ ├── secondLargestDigitInAString/ │ │ │ └── SecondLargestDigitInAString.cpp │ │ ├── sentenceScreenFitting/ │ │ │ ├── main.cpp │ │ │ ├── sentenceScreenFitting.cpp │ │ │ └── sentenceScreenFitting.h │ │ ├── sentenceSimilarity/ │ │ │ └── SentenceSimilarity.III.cpp │ │ ├── serializeAndDeserializeBinaryTree/ │ │ │ └── SerializeAndDeserializeBinaryTree.cpp │ │ ├── setMatrixZeroes/ │ │ │ └── setMatrixZeroes.cpp │ │ ├── shortEncodingOfWords/ │ │ │ └── ShortEncodingOfWords.cpp │ │ ├── shortestPalindrome/ │ │ │ └── ShortestPalindrome.cpp │ │ ├── shuffleAnArray/ │ │ │ └── ShuffleAnArray.cpp │ │ ├── shuffleString/ │ │ │ └── ShuffleString.cpp │ │ ├── shuffleTheArray/ │ │ │ └── ShuffleTheArray.cpp │ │ ├── signOfTheProductOfAnArray/ │ │ │ └── SignOfTheProductOfAnArray.cpp │ │ ├── simplifyPath/ │ │ │ └── simplifyPath.cpp │ │ ├── singleNumber/ │ │ │ ├── singleNumber.II.cpp │ │ │ ├── singleNumber.III.cpp │ │ │ └── singleNumber.cpp │ │ ├── singleThreadedCpu/ │ │ │ └── SingleThreadedCpu.cpp │ │ ├── slidingWindowMaximum/ │ │ │ └── SlidingWindowMaximum.cpp │ │ ├── smallestStringStartingFromLeaf/ │ │ │ └── SmallestStringStartingFromLeaf.cpp │ │ ├── sortArrayByParity/ │ │ │ ├── SortArrayByParity.II.cpp │ │ │ └── SortArrayByParity.cpp │ │ ├── sortColors/ │ │ │ └── sortColors.cpp │ │ ├── sortList/ │ │ │ └── sortList.cpp │ │ ├── sortingTheSentence/ │ │ │ └── SortingTheSentence.cpp │ │ ├── spiralMatrix/ │ │ │ ├── spiralMatrix.II.cpp │ │ │ └── spiralMatrix.cpp │ │ ├── splitArrayLargestSum/ │ │ │ └── SplitArrayLargestSum.cpp │ │ ├── splittingAStringIntoDescendingConsecutiveValues/ │ │ │ └── SplittingAStringIntoDescendingConsecutiveValues.cpp │ │ ├── sqrt/ │ │ │ └── sqrt.cpp │ │ ├── squaresOfASortedArray/ │ │ │ └── SquaresOfASortedArray.cpp │ │ ├── strStr/ │ │ │ └── strStr.cpp │ │ ├── stringToIntegerAtoi/ │ │ │ └── stringToIntegerAtoi.cpp │ │ ├── stringWithoutAAAOrBBB/ │ │ │ └── StringWithoutAAAOrBBB.cpp │ │ ├── subsets/ │ │ │ ├── subsets.II.cpp │ │ │ └── subsets.cpp │ │ ├── substringWithConcatenationOfAllWords/ │ │ │ └── substringWithConcatenationOfAllWords.cpp │ │ ├── substringsOfSizeThreeWithDistinctCharacters/ │ │ │ └── SubstringsOfSizeThreeWithDistinctCharacters.cpp │ │ ├── sudokuSolver/ │ │ │ └── sudokuSolver.cpp │ │ ├── sumOfBeautyOfAllSubstrings/ │ │ │ └── SumOfBeautyOfAllSubstrings.cpp │ │ ├── sumOfDigitsInBaseK/ │ │ │ └── SumOfDigitsInBaseK.cpp │ │ ├── sumOfDigitsOfStringAfterConvert/ │ │ │ └── SumOfDigitsOfStringAfterConvert.cpp │ │ ├── sumOfEvenNumbersAfterQueries/ │ │ │ └── SumOfEvenNumbersAfterQueries.cpp │ │ ├── sumOfFlooredPairs/ │ │ │ └── SumOfFlooredPairs.cpp │ │ ├── sumOfLeftLeaves/ │ │ │ └── SumOfLeftLeaves.cpp │ │ ├── sumOfTwoIntegers/ │ │ │ └── SumOfTwoIntegers.cpp │ │ ├── sumOfUniqueElements/ │ │ │ └── SumOfUniqueElements.cpp │ │ ├── sumRootToLeafNumber/ │ │ │ └── sumRootToLeafNumber.cpp │ │ ├── summaryRanges/ │ │ │ └── SummaryRanges.cpp │ │ ├── superUglyNumber/ │ │ │ └── SuperUglyNumber.cpp │ │ ├── surroundedRegions/ │ │ │ └── surroundedRegions.cpp │ │ ├── swapNodesInPairs/ │ │ │ └── swapNodesInPairs.cpp │ │ ├── symmetricTree/ │ │ │ └── symmetricTree.cpp │ │ ├── targetSum/ │ │ │ └── targetSum.cpp │ │ ├── textJustification/ │ │ │ └── textJustification.cpp │ │ ├── theSkylineProblem/ │ │ │ └── TheSkylineProblem.cpp │ │ ├── thirdMaximumNumber/ │ │ │ └── ThirdMaximumNumber.cpp │ │ ├── thousandSeparator/ │ │ │ └── ThousandSeparator.cpp │ │ ├── threeConsecutiveOdds/ │ │ │ └── ThreeConsecutiveOdds.cpp │ │ ├── timeBasedKeyValueStore/ │ │ │ └── TimeBasedKeyValueStore.cpp │ │ ├── timeNeededToInformAllEmployees/ │ │ │ └── TimeNeededToInformAllEmployees.cpp │ │ ├── topKFrequentElements/ │ │ │ └── topKFrequentElements.cpp │ │ ├── totalHammingDistance/ │ │ │ └── totalHammingDistance.cpp │ │ ├── trappingRainWater/ │ │ │ └── trappingRainWater.cpp │ │ ├── treeOfCoprimes/ │ │ │ └── TreeOfCoprimes.cpp │ │ ├── triangle/ │ │ │ └── triangle.cpp │ │ ├── triplesWithBitwiseANDEqualToZero/ │ │ │ └── TriplesWithBitwiseAndEqualToZero.cpp │ │ ├── truncateSentence/ │ │ │ └── TruncateSentence.cpp │ │ ├── tupleWithSameProduct/ │ │ │ └── TupleWithSameProduct.cpp │ │ ├── twoArraysEqualByReversingSubArrays/ │ │ │ └── MakeTwoArraysEqualByReversingSubArrays.cpp │ │ ├── twoCityScheduling/ │ │ │ └── TwoCityScheduling.cpp │ │ ├── twoSum/ │ │ │ ├── twoSum.II.cpp │ │ │ ├── twoSum.III.cpp │ │ │ └── twoSum.cpp │ │ ├── uglyNumber/ │ │ │ ├── UglyNumber.II.cpp │ │ │ └── UglyNumber.cpp │ │ ├── uniqueBinarySearchTrees/ │ │ │ ├── uniqueBinarySearchTrees.II.cpp │ │ │ └── uniqueBinarySearchTrees.cpp │ │ ├── uniqueEmailAddresses/ │ │ │ └── UniqueEmailAddresses.cpp │ │ ├── uniqueMorseCodeWords/ │ │ │ └── UniqueMorseCodeWords.cpp │ │ ├── uniqueNumberOfOccurrences/ │ │ │ └── Unique-Number-of-Occurrences.cpp │ │ ├── uniquePaths/ │ │ │ ├── UniquePaths.III.cpp │ │ │ ├── uniquePaths.II.cpp │ │ │ └── uniquePaths.cpp │ │ ├── validNumber/ │ │ │ └── validNumber.cpp │ │ ├── validPalindrome/ │ │ │ └── validPalindrome.cpp │ │ ├── validParentheses/ │ │ │ └── validParentheses.cpp │ │ ├── validPerfectSquare/ │ │ │ └── ValidPerfectSquare.cpp │ │ ├── validSudoku/ │ │ │ └── validSudoku.cpp │ │ ├── validateBinarySearchTree/ │ │ │ └── validateBinarySearchTree.cpp │ │ ├── verifyPreorderSerializationOfABinaryTree/ │ │ │ └── VerifyPreorderSerializationOfABinaryTree.cpp │ │ ├── verticalOrderTraversalOfABinaryTree/ │ │ │ └── VerticalOrderTraversalOfABinaryTree.cpp │ │ ├── videoStitching/ │ │ │ └── VideoStitching.cpp │ │ ├── waysToSplitArrayIntoThreeSubarrays/ │ │ │ └── WaysToSplitArrayIntoThreeSubarrays.cpp │ │ ├── wiggleSort/ │ │ │ └── WiggleSort.II.cpp │ │ ├── wiggleSubsequence/ │ │ │ └── wiggleSubsequence.cpp │ │ ├── wildcardMatching/ │ │ │ └── wildcardMatching.cpp │ │ ├── wordBreak/ │ │ │ ├── wordBreak.II.cpp │ │ │ └── wordBreak.cpp │ │ ├── wordLadder/ │ │ │ ├── wordLadder.II.cpp │ │ │ └── wordLadder.cpp │ │ ├── wordPattern/ │ │ │ └── WordPattern.cpp │ │ ├── wordSearch/ │ │ │ ├── wordSearch.II.cpp │ │ │ └── wordSearch.cpp │ │ └── zigZagConversion/ │ │ └── zigZagConversion.cpp │ ├── golang/ │ │ └── twoSum/ │ │ └── twoSum.go │ ├── java/ │ │ ├── algorithms-java.iml │ │ ├── junit-4.7.jar │ │ └── src/ │ │ ├── LargestNumberAfterMutatingSubstring/ │ │ │ └── largestNumberAfterMutatingSubstring.java │ │ ├── MaxSubArray/ │ │ │ └── MaxSubarray.java │ │ ├── RotateImage/ │ │ │ └── rotateImage.java │ │ ├── balancedBinaryTree/ │ │ │ ├── TreeNode.java │ │ │ ├── balancedBinaryTree.java │ │ │ └── balancedBinaryTreeTest.java │ │ ├── binarySearchTreeIterator/ │ │ │ ├── TreeNode.java │ │ │ ├── binarySearchTreeIterator.java │ │ │ └── binarySearchTreeIteratorTest.java │ │ ├── binaryTreeBFSTraversal/ │ │ │ ├── TreeNode.java │ │ │ ├── binaryTreeBFSTraversal.java │ │ │ └── binaryTreeBFSTraversalTest.java │ │ ├── binaryTreeLevelOrderTraversal/ │ │ │ ├── TreeNode.java │ │ │ ├── binaryTreeLevelOrderTraversal.java │ │ │ └── binaryTreeLevelOrderTraversalTest.java │ │ ├── binaryTreeMaximumPathSum/ │ │ │ ├── TreeNode.java │ │ │ ├── binaryTreeMaximumPathSum.java │ │ │ └── binaryTreeMaximumPathSumTest.java │ │ ├── binaryTreePreorderTraversal/ │ │ │ ├── TreeNode.java │ │ │ ├── binaryTreePreorderTraversal.java │ │ │ └── binaryTreePreorderTraversalTest.java │ │ ├── containerwithmostwater.java │ │ ├── countAndSay/ │ │ │ ├── CountAndSay.java │ │ │ └── TestCountAndSay.java │ │ ├── dynamicProgramming/ │ │ │ ├── climbStairs/ │ │ │ │ ├── climbStairs.java │ │ │ │ └── climbStairsTest.java │ │ │ ├── minimumPathSum/ │ │ │ │ ├── minimumPathSum.java │ │ │ │ └── minimumPathSumTest.java │ │ │ ├── triangle/ │ │ │ │ ├── triangle.java │ │ │ │ └── triangleTest.java │ │ │ └── uniquePaths/ │ │ │ ├── uniquePaths.java │ │ │ ├── uniquePathsII.java │ │ │ ├── uniquePathsIITest.java │ │ │ └── uniquePathsTest.java │ │ ├── findMinimumInRotatedSortedArray/ │ │ │ ├── findMinimumInRotatedSortedArray.java │ │ │ └── findMinimumInRotatedSortedArrayTest.java │ │ ├── findPeakElement/ │ │ │ ├── findPeakElement.java │ │ │ └── findPeakElementTest.java │ │ ├── firstBadVersion/ │ │ │ ├── VersionControl.java │ │ │ ├── firstBadVersion.java │ │ │ └── firstBadVersionTest.java │ │ ├── inorderSuccessorInBST/ │ │ │ ├── TreeNode.java │ │ │ ├── inorderSuccessorInBST.java │ │ │ └── inorderSuccessorInBSTTest.java │ │ ├── lengthOfLastWord/ │ │ │ ├── LengthOfLastWord.java │ │ │ └── TestLengthOfLastWord.java │ │ ├── lowestCommonAncestorOfABinaryTree/ │ │ │ ├── TreeNode.java │ │ │ ├── lowestCommonAncestorOfABinaryTree.java │ │ │ └── lowestCommonAncestorOfABinaryTreeTest.java │ │ ├── lruCache/ │ │ │ ├── LRUCache.java │ │ │ └── LRUCacheTest.java │ │ ├── maximumDepthOfBinaryTree/ │ │ │ ├── TreeNode.java │ │ │ ├── maximumDepthOfBinaryTree.java │ │ │ └── maximumDepthOfBinaryTreeTest.java │ │ ├── minStack/ │ │ │ ├── MinStack.java │ │ │ └── TestMinStack.java │ │ ├── myQueue/ │ │ │ ├── MyQueue.java │ │ │ └── TestMyQueue.java │ │ ├── myStack/ │ │ │ ├── MyStack.java │ │ │ └── TestMyStack.java │ │ ├── palindromeNumber/ │ │ │ ├── PalindromeNumber.java │ │ │ └── TestPalindromeNumber.java │ │ ├── powXn/ │ │ │ ├── PowXn.java │ │ │ └── TestPowXn.java │ │ ├── removeDuplicatesFromSortedArray/ │ │ │ ├── RemoveDuplicatesFromSortedArray.java │ │ │ └── TestRemoveDuplicates.java │ │ ├── reverseLinkedList/ │ │ │ ├── ListNode.java │ │ │ ├── ReverseLinkedList.java │ │ │ └── TestReverseLinkedList.java │ │ ├── reverseLinkedListII/ │ │ │ ├── ListNode.java │ │ │ ├── ReverseLinkedListII.java │ │ │ └── TestReverseLinkedListII.java │ │ ├── reverseWordsInAString/ │ │ │ ├── ReverseWordsInAString.java │ │ │ └── TestReverseWordsInAString.java │ │ ├── rotateArray/ │ │ │ ├── RotateArray.java │ │ │ └── TestRotateArray.java │ │ ├── search2DMatrix/ │ │ │ ├── search2DMatrix.java │ │ │ └── search2DMatrixTest.java │ │ ├── searchA2DMatrixII/ │ │ │ ├── SearchA2DMatrixII.java │ │ │ └── Test_240.java │ │ ├── searchForRange/ │ │ │ ├── searchForRange.java │ │ │ └── searchForRangeTest.java │ │ ├── searchInABigSortedArray/ │ │ │ ├── searchInABigSortedArray.java │ │ │ └── searchInABigSortedArrayTest.java │ │ ├── searchInRotatedSortedArray/ │ │ │ ├── searchInRotatedSortedArray.java │ │ │ └── searchInRotatedSortedArrayTest.java │ │ ├── searchInsertPosition/ │ │ │ ├── searchInsertPosition.java │ │ │ └── searchInsertPositionTest.java │ │ ├── searchRangeInBinarySearchTree/ │ │ │ ├── TreeNode.java │ │ │ ├── searchRangeInBinarySearchTree.java │ │ │ └── searchRangeInBinarySearchTreeTest.java │ │ ├── strStr/ │ │ │ ├── StrStrKmp.java │ │ │ ├── TestStrStrKmp.java │ │ │ ├── strStr.java │ │ │ └── strStrTest.java │ │ ├── subsets/ │ │ │ ├── subsets.java │ │ │ ├── subsetsII.java │ │ │ ├── subsetsIITest.java │ │ │ └── subsetsTest.java │ │ ├── validAnagram/ │ │ │ ├── TestValidAnagram.java │ │ │ └── ValidAnagram.java │ │ ├── validPalindrome/ │ │ │ ├── TestValidPalindrome.java │ │ │ └── ValidPalindrome.java │ │ └── validateBinarySearchTree/ │ │ ├── TreeNode.java │ │ ├── validateBinarySearchTree.java │ │ └── validateBinarySearchTreeTest.java │ └── python/ │ ├── 1-bitAnd2-bitCharacters/ │ │ └── isOneBitCharacter.py │ ├── AddOneRowToTree/ │ │ └── addOneRow.py │ ├── BinarySearchTreeIterator/ │ │ └── BSTIterator.py │ ├── BinaryTreePostorderTraversal/ │ │ └── postorderTraversal.py │ ├── BinaryTreeTilt/ │ │ └── findTilt.py │ ├── BinaryTreeZigzagLevelOrderTraversal/ │ │ └── zigzagLevelOrder.py │ ├── CheckCompletenessOfABinaryTree/ │ │ └── isCompleteTree.py │ ├── ConstructBinaryTreeFromInorderAndPostorderTraversal/ │ │ └── buildTree.py │ ├── ConstructBinaryTreeFromPreorderAndInorderTraversal/ │ │ └── buildTree.py │ ├── ContainsDuplicateII/ │ │ └── containsNearbyDuplicate.py │ ├── ContainsDuplicateIII/ │ │ └── containsNearbyAlmostDuplicate.py │ ├── ConvertBSTtoGreaterTree/ │ │ └── convertBST.py │ ├── CopyListWithRandomPointer/ │ │ └── copyRandomList.py │ ├── CountCompleteTreeNodes/ │ │ └── countNodes.py │ ├── DeleteNodeInABST/ │ │ └── deleteNode.py │ ├── DiameterOfBinaryTree/ │ │ └── diameterOfBinaryTree.py │ ├── DifferentWaysToAddParentheses/ │ │ └── diffWaysToCompute.py │ ├── FibonacciNumber/ │ │ └── fib.py │ ├── FindDuplicateSubtrees/ │ │ └── findDuplicateSubtrees.py │ ├── FindTheDuplicateNumber/ │ │ └── findDuplicate.py │ ├── FlattenBinaryTreeToLinkedList/ │ │ └── flatten.py │ ├── FlipBinaryTreeToMatchPreorderTraversal/ │ │ └── flipMatchVoyage.py │ ├── FlipEquivalentBinaryTrees/ │ │ └── flipEquiv.py │ ├── HappyNumber/ │ │ └── isHappy.py │ ├── HouseRobber/ │ │ └── rob.py │ ├── HouseRobberIII/ │ │ └── rob.py │ ├── ImageSmoother/ │ │ └── imageSmoother.py │ ├── InsertionSortList/ │ │ └── insertionSortList.py │ ├── K-diffPairsInAnArray/ │ │ └── findPairs.py │ ├── KthSmallestElementInABST/ │ │ └── kthSmallest.py │ ├── LargestNumberAtLeastTwiceOfOthers/ │ │ └── dominantIndex.py │ ├── LargestPerimeterTriangle/ │ │ └── largestPerimeter.py │ ├── LinkedListCycleII/ │ │ └── detectCycle.py │ ├── LongestConsecutiveSequence/ │ │ └── LongestConsecutive.py │ ├── LongestContinuousIncreasingSubsequence/ │ │ └── findLengthOfLCIS.py │ ├── LongestTurbulentSubarray/ │ │ └── maxTurbulenceSize.py │ ├── LongestUnivaluePath/ │ │ └── longestUnivaluePath.py │ ├── LowestCommonAncestorOfABinarySearchTree/ │ │ └── lowestCommonAncestor.py │ ├── LowestCommonAncestorOfABinaryTree/ │ │ └── lowestCommonAncestor.py │ ├── MaximizeDistanceToClosestPerson/ │ │ └── maxDistToClosest.py │ ├── MaximumAverageSubarrayI/ │ │ └── findMaxAverage.py │ ├── MaximumProductOfThreeNumbers/ │ │ └── maximumProduct.py │ ├── MaximumWidthOfBinaryTree/ │ │ └── widthOfBinaryTree.py │ ├── MiddleOfTheLinkedList/ │ │ └── middleOfTheLinkedList.py │ ├── MinCostClimbingStairs/ │ │ └── minCostClimbingStairs.py │ ├── Non-decreasingArray/ │ │ └── checkPossibility.py │ ├── NumberOfIslands/ │ │ └── numIslands.py │ ├── PancakeSorting/ │ │ └── pancakeSort.py │ ├── PartitionList/ │ │ └── partition.py │ ├── PathSumII/ │ │ └── pathSum.py │ ├── PathSumIII/ │ │ └── pathSum.py │ ├── PopulatingNextRightPointersInEachNode/ │ │ └── connect.py │ ├── PopulatingNextRightPointersInEachNodeII/ │ │ └── connect.py │ ├── PositionsOfLargeGroups/ │ │ └── largeGroupPositions.py │ ├── PrintBinaryTree/ │ │ └── printTree.py │ ├── RedundantConnection/ │ │ └── findRedundantConnection.py │ ├── RemoveDuplicatesFromSortedListII/ │ │ └── deleteDuplicates.py │ ├── RemoveNthNodeFromEndOfList/ │ │ └── removeNthFromEnd.py │ ├── ReorderList/ │ │ └── reorderList.py │ ├── RevealCardsInIncreasingOrder/ │ │ └── deckRevealedIncreasing.py │ ├── ReverseLinkedListII/ │ │ └── reverseBetween.py │ ├── SearchA2DMatrixII/ │ │ └── searchMatrix.py │ ├── SecondMinimumNodeInABinaryTree/ │ │ └── findSecondMinimumValue.py │ ├── SerializeAndDeserializeBST/ │ │ └── serialize.py │ ├── ShortestUnsortedContinuousSubarray/ │ │ └── findUnsortedSubarray.py │ ├── SingleNumberII/ │ │ └── SingleNumberII.py │ ├── SortList/ │ │ └── sortList.py │ ├── SquaresOfSortedArray/ │ │ └── sortedSquares.py │ ├── Subsets/ │ │ └── subsets.py │ ├── SubtreeOfAnotherTree/ │ │ └── isSubtree.py │ ├── SumOfLeftLeaves/ │ │ └── sumOfLeftLeaves.py │ ├── SumRootToLeafNumbers/ │ │ └── sumNumbers.py │ ├── SwimInRisingWater/ │ │ └── swim_in_rising_water.py │ ├── ThirdMaximumNumber/ │ │ └── thirdMax.py │ ├── UniqueBinarySearchTrees/ │ │ └── numTrees.py │ ├── UniqueBinarySearchTreesII/ │ │ └── generateTrees.py │ ├── ValidMountainArray/ │ │ └── validMountainArray.py │ ├── ValidateBinarySearchTree/ │ │ └── isValidBST.py │ ├── XOfAKindInADeckOfCards/ │ │ └── hasGroupsSizeX.py │ ├── firstMissingPositive/ │ │ └── firstMissingPositive.py │ ├── jumpGame/ │ │ └── jumpGame.py │ └── uniquePaths/ │ └── uniquePathsIII.py ├── database/ │ ├── README.md │ └── TripsAndUsers.sql ├── scripts/ │ ├── README.md │ ├── comments.sh │ ├── git.config.sh │ ├── lib/ │ │ └── query_problem.sh │ ├── readme.sh │ └── workflow.sh └── shell/ ├── README.md ├── TenthLine.sh ├── TransposeFile.sh ├── ValidPhoneNumbers.sh └── WordFrequency.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .idea algorithms-java/out *.class ================================================ FILE: README.md ================================================ LeetCode ======== ### LeetCode Algorithm (Notes: "🔒" means you need to buy a book from Leetcode) | # | Title | Solution | Difficulty | |---| ----- | -------- | ---------- | |1946|[Largest Number After Mutating Substring](https://leetcode.com/problems/largest-number-after-mutating-substring/) | [C++](./algorithms/cpp/largestNumberAfterMutatingSubstring/LargestNumberAfterMutatingSubstring.cpp), [Java](./algorithms/java/src/LargestNumberAfterMutatingSubtring/largestNumberAfterMutatingSubstring.java)|Medium| |1945|[Sum of Digits of String After Convert](https://leetcode.com/problems/sum-of-digits-of-string-after-convert/) | [C++](./algorithms/cpp/leetcode/sumOfDigitsOfStringAfterConvert/SumOfDigitsOfStringAfterConvert.cpp)|Easy| |1935|[Maximum Number of Words You Can Type](https://leetcode.com/problems/maximum-number-of-words-you-can-type/) | [C++](./algorithms/cpp/maximumNumberOfWordsYouCanType/MaximumNumberOfWordsYouCanType.cpp)|Easy| |1884|[Egg Drop With 2 Eggs and N Floors](https://leetcode.com/problems/egg-drop-with-2-eggs-and-n-floors/) | [C++](./algorithms/cpp/eggDropWith2EggsAndNFloors/EggDropWith2EggsAndNFloors.cpp)|Medium| |1882|[Process Tasks Using Servers](https://leetcode.com/problems/process-tasks-using-servers/) | [C++](./algorithms/cpp/processTasksUsingServers/ProcessTasksUsingServers.cpp)|Medium| |1881|[Maximum Value after Insertion](https://leetcode.com/problems/maximum-value-after-insertion/) | [C++](./algorithms/cpp/maximumValueAfterInsertion/MaximumValueAfterInsertion.cpp)|Medium| |1880|[Check if Word Equals Summation of Two Words](https://leetcode.com/problems/check-if-word-equals-summation-of-two-words/) | [C++](./algorithms/cpp/checkIfWordEqualsSummationOfTwoWords/CheckIfWordEqualsSummationOfTwoWords.cpp)|Easy| |1877|[Minimize Maximum Pair Sum in Array](https://leetcode.com/problems/minimize-maximum-pair-sum-in-array/) | [C++](./algorithms/cpp/minimizeMaximumPairSumInArray/MinimizeMaximumPairSumInArray.cpp)|Medium| |1876|[Substrings of Size Three with Distinct Characters](https://leetcode.com/problems/substrings-of-size-three-with-distinct-characters/submissions/) | [C++](./algorithms/cpp/substringsOfSizeThreeWithDistinctCharacters/SubstringsOfSizeThreeWithDistinctCharacters.cpp)|Easy| |1871|[Jump Game VII](https://leetcode.com/problems/jump-game-vii/) | [C++](./algorithms/cpp/jumpGame/jumpGame.VII.cpp)|Medium| |1870|[Minimum Speed to Arrive on Time](https://leetcode.com/problems/minimum-speed-to-arrive-on-time/) | [C++](./algorithms/cpp/minimumSpeedToArriveOnTime/MinimumSpeedToArriveOnTime.cpp)|Medium| |1869|[Longer Contiguous Segments of Ones than Zeros](https://leetcode.com/problems/longer-contiguous-segments-of-ones-than-zeros/) | [C++](./algorithms/cpp/longerContiguousSegmentsOfOnesThanZeros/LongerContiguousSegmentsOfOnesThanZeros.cpp)|Easy| |1862|[Sum of Floored Pairs](https://leetcode.com/problems/sum-of-floored-pairs/) | [C++](./algorithms/cpp/sumOfFlooredPairs/SumOfFlooredPairs.cpp)|Hard| |1861|[Rotating the Box](https://leetcode.com/problems/rotating-the-box/) | [C++](./algorithms/cpp/rotatingTheBox/RotatingTheBox.cpp)|Medium| |1860|[Incremental Memory Leak](https://leetcode.com/problems/incremental-memory-leak/) | [C++](./algorithms/cpp/incrementalMemoryLeak/IncrementalMemoryLeak.cpp)|Medium| |1859|[Sorting the Sentence](https://leetcode.com/problems/sorting-the-sentence/) | [C++](./algorithms/cpp/sortingTheSentence/SortingTheSentence.cpp)|Easy| |1857|[Largest Color Value in a Directed Graph](https://leetcode.com/problems/largest-color-value-in-a-directed-graph/) | [C++](./algorithms/cpp/largestColorValueInADirectedGraph/LargestColorValueInADirectedGraph.cpp)|Hard| |1856|[Maximum Subarray Min-Product](https://leetcode.com/problems/maximum-subarray-min-product/) | [C++](./algorithms/cpp/maximumSubarrayMinProduct/MaximumSubarrayMinProduct.cpp)|Medium| |1855|[Maximum Distance Between a Pair of Values](https://leetcode.com/problems/maximum-distance-between-a-pair-of-values/) | [C++](./algorithms/cpp/maximumDistanceBetweenAPairOfValues/MaximumDistanceBetweenAPairOfValues.cpp)|Medium| |1854|[Maximum Population Year](https://leetcode.com/problems/maximum-population-year/) | [C++](./algorithms/cpp/maximumPopulationYear/MaximumPopulationYear.cpp)|Easy| |1851|[Minimum Interval to Include Each Query](https://leetcode.com/problems/minimum-interval-to-include-each-query/) | [C++](./algorithms/cpp/minimumIntervalToIncludeEachQuery/MinimumIntervalToIncludeEachQuery.cpp)|Hard| |1850|[Minimum Adjacent Swaps to Reach the Kth Smallest Number](https://leetcode.com/problems/minimum-adjacent-swaps-to-reach-the-kth-smallest-number/) | [C++](./algorithms/cpp/minimumAdjacentSwapsToReachTheKthSmallestNumber/MinimumAdjacentSwapsToReachTheKthSmallestNumber.cpp)|Medium| |1849|[Splitting a String Into Descending Consecutive Values](https://leetcode.com/problems/splitting-a-string-into-descending-consecutive-values/) | [C++](./algorithms/cpp/splittingAStringIntoDescendingConsecutiveValues/SplittingAStringIntoDescendingConsecutiveValues.cpp)|Medium| |1848|[Minimum Distance to the Target Element](https://leetcode.com/problems/minimum-distance-to-the-target-element/) | [C++](./algorithms/cpp/minimumDistanceToTheTargetElement/MinimumDistanceToTheTargetElement.cpp)|Easy| |1847|[Closest Room](https://leetcode.com/problems/closest-room/) | [C++](./algorithms/cpp/closestRoom/ClosestRoom.cpp)|Hard| |1846|[Maximum Element After Decreasing and Rearranging](https://leetcode.com/problems/maximum-element-after-decreasing-and-rearranging/) | [C++](./algorithms/cpp/maximumElementAfterDecreasingAndRearranging/MaximumElementAfterDecreasingAndRearranging.cpp)|Medium| |1845|[Seat Reservation Manager](https://leetcode.com/problems/seat-reservation-manager/) | [C++](./algorithms/cpp/seatReservationManager/SeatReservationManager.cpp)|Medium| |1844|[Replace All Digits with Characters](https://leetcode.com/problems/replace-all-digits-with-characters/) | [C++](./algorithms/cpp/replaceAllDigitsWithCharacters/ReplaceAllDigitsWithCharacters.cpp)|Easy| |1840|[Maximum Building Height](https://leetcode.com/problems/maximum-building-height/) | [C++](./algorithms/cpp/maximumBuildingHeight/MaximumBuildingHeight.cpp)|Hard| |1839|[Longest Substring Of All Vowels in Order](https://leetcode.com/problems/longest-substring-of-all-vowels-in-order/) | [C++](./algorithms/cpp/longestSubstringOfAllVowelsInOrder/LongestSubstringOfAllVowelsInOrder.cpp)|Medium| |1838|[Frequency of the Most Frequent Element](https://leetcode.com/problems/frequency-of-the-most-frequent-element/) | [C++](./algorithms/cpp/frequencyOfTheMostFrequentElement/FrequencyOfTheMostFrequentElement.cpp)|Medium| |1837|[Sum of Digits in Base K](https://leetcode.com/problems/sum-of-digits-in-base-k/) | [C++](./algorithms/cpp/sumOfDigitsInBaseK/SumOfDigitsInBaseK.cpp)|Easy| |1835|[Find XOR Sum of All Pairs Bitwise AND](https://leetcode.com/problems/find-xor-sum-of-all-pairs-bitwise-and/) | [C++](./algorithms/cpp/findXorSumOfAllPairsBitwiseAnd/FindXorSumOfAllPairsBitwiseAnd.cpp)|Hard| |1834|[Single-Threaded CPU](https://leetcode.com/problems/single-threaded-cpu/) | [C++](./algorithms/cpp/singleThreadedCpu/SingleThreadedCpu.cpp)|Medium| |1833|[Maximum Ice Cream Bars](https://leetcode.com/problems/maximum-ice-cream-bars/) | [C++](./algorithms/cpp/maximumIceCreamBars/MaximumIceCreamBars.cpp)|Medium| |1832|[Check if the Sentence Is Pangram](https://leetcode.com/problems/check-if-the-sentence-is-pangram/) | [C++](./algorithms/cpp/checkIfTheSentenceIsPangram/CheckIfTheSentenceIsPangram.cpp)|Easy| |1829|[Maximum XOR for Each Query](https://leetcode.com/problems/maximum-xor-for-each-query/) | [C++](./algorithms/cpp/maximumXorForEachQuery/MaximumXorForEachQuery.cpp)|Medium| |1828|[Queries on Number of Points Inside a Circle](https://leetcode.com/problems/queries-on-number-of-points-inside-a-circle/) | [C++](./algorithms/cpp/queriesOnNumberOfPointsInsideACircle/QueriesOnNumberOfPointsInsideACircle.cpp)|Medium| |1827|[Minimum Operations to Make the Array Increasing](https://leetcode.com/problems/minimum-operations-to-make-the-array-increasing/) | [C++](./algorithms/cpp/minimumOperationsToMakeTheArrayIncreasing/MinimumOperationsToMakeTheArrayIncreasing.cpp)|Easy| |1825|[Finding MK Average](https://leetcode.com/problems/finding-mk-average/) | [C++](./algorithms/cpp/findingMkAverage/FindingMkAverage.cpp)|Hard| |1824|[Minimum Sideway Jumps](https://leetcode.com/problems/minimum-sideway-jumps/) | [C++](./algorithms/cpp/minimumSidewayJumps/MinimumSidewayJumps.cpp)|Medium| |1823|[Find the Winner of the Circular Game](https://leetcode.com/problems/find-the-winner-of-the-circular-game/) | [C++](./algorithms/cpp/findTheWinnerOfTheCircularGame/FindTheWinnerOfTheCircularGame.cpp)|Medium| |1822|[Sign of the Product of an Array](https://leetcode.com/problems/sign-of-the-product-of-an-array/) | [C++](./algorithms/cpp/signOfTheProductOfAnArray/SignOfTheProductOfAnArray.cpp)|Easy| |1819|[Number of Different Subsequences GCDs](https://leetcode.com/problems/number-of-different-subsequences-gcds/) | [C++](./algorithms/cpp/numberOfDifferentSubsequencesGcds/NumberOfDifferentSubsequencesGcds.cpp)|Hard| |1818|[Minimum Absolute Sum Difference](https://leetcode.com/problems/minimum-absolute-sum-difference/) | [C++](./algorithms/cpp/minimumAbsoluteSumDifference/MinimumAbsoluteSumDifference.cpp)|Medium| |1817|[Finding the Users Active Minutes](https://leetcode.com/problems/finding-the-users-active-minutes/) | [C++](./algorithms/cpp/findingTheUsersActiveMinutes/FindingTheUsersActiveMinutes.cpp)|Medium| |1816|[Truncate Sentence](https://leetcode.com/problems/truncate-sentence/) | [C++](./algorithms/cpp/truncateSentence/TruncateSentence.cpp)|Easy| |1815|[Maximum Number of Groups Getting Fresh Donuts](https://leetcode.com/problems/maximum-number-of-groups-getting-fresh-donuts/) | [C++](./algorithms/cpp/maximumNumberOfGroupsGettingFreshDonuts/MaximumNumberOfGroupsGettingFreshDonuts.cpp)|Hard| |1814|[Count Nice Pairs in an Array](https://leetcode.com/problems/count-nice-pairs-in-an-array/) | [C++](./algorithms/cpp/countNicePairsInAnArray/CountNicePairsInAnArray.cpp)|Medium| |1813|[Sentence Similarity III](https://leetcode.com/problems/sentence-similarity-iii/) | [C++](./algorithms/cpp/sentenceSimilarity/SentenceSimilarity.III.cpp)|Medium| |1812|[Determine Color of a Chessboard Square](https://leetcode.com/problems/determine-color-of-a-chessboard-square/) | [C++](./algorithms/cpp/determineColorOfAChessboardSquare/DetermineColorOfAChessboardSquare.cpp)|Easy| |1808|[Maximize Number of Nice Divisors](https://leetcode.com/problems/maximize-number-of-nice-divisors/) | [C++](./algorithms/cpp/maximizeNumberOfNiceDivisors/MaximizeNumberOfNiceDivisors.cpp)|Hard| |1807|[Evaluate the Bracket Pairs of a String](https://leetcode.com/problems/evaluate-the-bracket-pairs-of-a-string/) | [C++](./algorithms/cpp/evaluateTheBracketPairsOfAString/EvaluateTheBracketPairsOfAString.cpp)|Medium| |1806|[Minimum Number of Operations to Reinitialize a Permutation](https://leetcode.com/problems/minimum-number-of-operations-to-reinitialize-a-permutation/) | [C++](./algorithms/cpp/minimumNumberOfOperationsToReinitializeAPermutation/MinimumNumberOfOperationsToReinitializeAPermutation.cpp)|Medium| |1805|[Number of Different Integers in a String](https://leetcode.com/problems/number-of-different-integers-in-a-string/) | [C++](./algorithms/cpp/numberOfDifferentIntegersInAString/NumberOfDifferentIntegersInAString.cpp)|Easy| |1803|[Count Pairs With XOR in a Range](https://leetcode.com/problems/count-pairs-with-xor-in-a-range/) | [C++](./algorithms/cpp/countPairsWithXorInARange/CountPairsWithXorInARange.cpp)|Hard| |1802|[Maximum Value at a Given Index in a Bounded Array](https://leetcode.com/problems/maximum-value-at-a-given-index-in-a-bounded-array/) | [C++](./algorithms/cpp/maximumValueAtAGivenIndexInABoundedArray/MaximumValueAtAGivenIndexInABoundedArray.cpp)|Medium| |1801|[Number of Orders in the Backlog](https://leetcode.com/problems/number-of-orders-in-the-backlog/) | [C++](./algorithms/cpp/numberOfOrdersInTheBacklog/NumberOfOrdersInTheBacklog.cpp)|Medium| |1800|[Maximum Ascending Subarray Sum](https://leetcode.com/problems/maximum-ascending-subarray-sum/) | [C++](./algorithms/cpp/maximumAscendingSubarraySum/MaximumAscendingSubarraySum.cpp)|Easy| |1799|[Maximize Score After N Operations](https://leetcode.com/problems/maximize-score-after-n-operations/submissions/) | [C++](./algorithms/cpp/maximizeScoreAfterNOperations/MaximizeScoreAfterNOperations.cpp)|Hard| |1798|[Maximum Number of Consecutive Values You Can Make](https://leetcode.com/problems/maximum-number-of-consecutive-values-you-can-make/submissions/) | [C++](./algorithms/cpp/maximumNumberOfConsecutiveValuesYouCanMake/MaximumNumberOfConsecutiveValuesYouCanMake.cpp)|Medium| |1797|[Design Authentication Manager](https://leetcode.com/problems/design-authentication-manager/) | [C++](./algorithms/cpp/designAuthenticationManager/DesignAuthenticationManager.cpp)|Medium| |1796|[Second Largest Digit in a String](https://leetcode.com/problems/second-largest-digit-in-a-string/) | [C++](./algorithms/cpp/secondLargestDigitInAString/SecondLargestDigitInAString.cpp)|Easy| |1793|[Maximum Score of a Good Subarray](https://leetcode.com/problems/maximum-score-of-a-good-subarray/) | [C++](./algorithms/cpp/maximumScoreOfAGoodSubarray/MaximumScoreOfAGoodSubarray.cpp)|Hard| |1792|[Maximum Average Pass Ratio](https://leetcode.com/problems/maximum-average-pass-ratio/) | [C++](./algorithms/cpp/maximumAveragePassRatio/MaximumAveragePassRatio.cpp)|Medium| |1791|[Find Center of Star Graph](https://leetcode.com/problems/find-center-of-star-graph/) | [C++](./algorithms/cpp/findCenterOfStarGraph/FindCenterOfStarGraph.cpp)|Medium| |1790|[Check if One String Swap Can Make Strings Equal](https://leetcode.com/problems/check-if-one-string-swap-can-make-strings-equal/) | [C++](./algorithms/cpp/checkIfOneStringSwapCanMakeStringsEqual/CheckIfOneStringSwapCanMakeStringsEqual.cpp)|Easy| |1787|[Make the XOR of All Segments Equal to Zero](https://leetcode.com/problems/make-the-xor-of-all-segments-equal-to-zero/) | [C++](./algorithms/cpp/makeTheXorOfAllSegmentsEqualToZero/MakeTheXorOfAllSegmentsEqualToZero.cpp)|Hard| |1786|[Number of Restricted Paths From First to Last Node](https://leetcode.com/problems/number-of-restricted-paths-from-first-to-last-node/) | [C++](./algorithms/cpp/numberOfRestrictedPathsFromFirstToLastNode/NumberOfRestrictedPathsFromFirstToLastNode.cpp)|Medium| |1785|[Minimum Elements to Add to Form a Given Sum](https://leetcode.com/problems/minimum-elements-to-add-to-form-a-given-sum/) | [C++](./algorithms/cpp/minimumElementsToAddToFormAGivenSum/MinimumElementsToAddToFormAGivenSum.cpp)|Medium| |1784|[Check if Binary String Has at Most One Segment of Ones](https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones/) | [C++](./algorithms/cpp/checkIfBinaryStringHasAtMostOneSegmentOfOnes/CheckIfBinaryStringHasAtMostOneSegmentOfOnes.cpp)|Easy| |1782|[Count Pairs Of Nodes](https://leetcode.com/problems/count-pairs-of-nodes/) | [C++](./algorithms/cpp/countPairsOfNodes/CountPairsOfNodes.cpp)|Hard| |1781|[Sum of Beauty of All Substrings](https://leetcode.com/problems/sum-of-beauty-of-all-substrings/) | [C++](./algorithms/cpp/sumOfBeautyOfAllSubstrings/SumOfBeautyOfAllSubstrings.cpp)|Medium| |1780|[Check if Number is a Sum of Powers of Three](https://leetcode.com/problems/check-if-number-is-a-sum-of-powers-of-three/) | [C++](./algorithms/cpp/checkIfNumberIsASumOfPowersOfThree/CheckIfNumberIsASumOfPowersOfThree.cpp)|Medium| |1779|[Find Nearest Point That Has the Same X or Y Coordinate](https://leetcode.com/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate/) | [C++](./algorithms/cpp/findNearestPointThatHasTheSameXOrYCoordinate/FindNearestPointThatHasTheSameXOrYCoordinate.cpp)|Easy| |1775|[Equal Sum Arrays With Minimum Number of Operations](https://leetcode.com/problems/equal-sum-arrays-with-minimum-number-of-operations/) | [C++](./algorithms/cpp/equalSumArraysWithMinimumNumberOfOperations/EqualSumArraysWithMinimumNumberOfOperations.cpp)|Medium| |1774|[Closest Dessert Cost](https://leetcode.com/problems/closest-dessert-cost/) | [C++](./algorithms/cpp/closestDessertCost/ClosestDessertCost.cpp)|Medium| |1773|[Count Items Matching a Rule](https://leetcode.com/problems/count-items-matching-a-rule/) | [C++](./algorithms/cpp/countItemsMatchingARule/CountItemsMatchingARule.cpp)|Easy| |1771|[Maximize Palindrome Length From Subsequences](https://leetcode.com/problems/maximize-palindrome-length-from-subsequences/) | [C++](./algorithms/cpp/maximizePalindromeLengthFromSubsequences/MaximizePalindromeLengthFromSubsequences.cpp)|Hard| |1770|[Maximum Score from Performing Multiplication Operations](https://leetcode.com/problems/maximum-score-from-performing-multiplication-operations/) | [C++](./algorithms/cpp/maximumScoreFromPerformingMultiplicationOperations/MaximumScoreFromPerformingMultiplicationOperations.cpp)|Medium| |1769|[Minimum Number of Operations to Move All Balls to Each Box](https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/) | [C++](./algorithms/cpp/minimumNumberOfOperationsToMoveAllBallsToEachBox/MinimumNumberOfOperationsToMoveAllBallsToEachBox.cpp)|Medium| |1768|[Merge Strings Alternately](https://leetcode.com/problems/merge-strings-alternately/) | [C++](./algorithms/cpp/mergeStringsAlternately/MergeStringsAlternately.cpp)|Easy| |1766|[Tree of Coprimes](https://leetcode.com/problems/tree-of-coprimes/) | [C++](./algorithms/cpp/treeOfCoprimes/TreeOfCoprimes.cpp)|Hard| |1765|[Map of Highest Peak](https://leetcode.com/problems/map-of-highest-peak/) | [C++](./algorithms/cpp/mapOfHighestPeak/MapOfHighestPeak.cpp)|Medium| |1764|[Form Array by Concatenating Subarrays of Another Array](https://leetcode.com/problems/form-array-by-concatenating-subarrays-of-another-array/) | [C++](./algorithms/cpp/formArrayByConcatenatingSubarraysOfAnotherArray/FormArrayByConcatenatingSubarraysOfAnotherArray.cpp)|Medium| |1763|[Longest Nice Substring](https://leetcode.com/problems/longest-nice-substring/) | [C++](./algorithms/cpp/longestNiceSubstring/LongestNiceSubstring.cpp)|Easy| |1761|[Minimum Degree of a Connected Trio in a Graph](https://leetcode.com/problems/minimum-degree-of-a-connected-trio-in-a-graph/) | [C++](./algorithms/cpp/minimumDegreeOfAConnectedTrioInAGraph/MinimumDegreeOfAConnectedTrioInAGraph.cpp)|Hard| |1760|[Minimum Limit of Balls in a Bag](https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag/) | [C++](./algorithms/cpp/minimumLimitOfBallsInABag/MinimumLimitOfBallsInABag.cpp)|Medium| |1759|[Count Number of Homogenous Substrings](https://leetcode.com/problems/count-number-of-homogenous-substrings/) | [C++](./algorithms/cpp/countNumberOfHomogenousSubstrings/CountNumberOfHomogenousSubstrings.cpp)|Medium| |1758|[Minimum Changes To Make Alternating Binary String](https://leetcode.com/problems/minimum-changes-to-make-alternating-binary-string/) | [C++](./algorithms/cpp/minimumChangesToMakeAlternatingBinaryString/MinimumChangesToMakeAlternatingBinaryString.cpp)|Easy| |1755|[Closest Subsequence Sum](https://leetcode.com/problems/closest-subsequence-sum/) | [C++](./algorithms/cpp/closestSubsequenceSum/ClosestSubsequenceSum.cpp)|Hard| |1754|[Largest Merge Of Two Strings](https://leetcode.com/problems/largest-merge-of-two-strings/) | [C++](./algorithms/cpp/largestMergeOfTwoStrings/LargestMergeOfTwoStrings.cpp)|Medium| |1753|[Maximum Score From Removing Stones](https://leetcode.com/problems/maximum-score-from-removing-stones/) | [C++](./algorithms/cpp/maximumScoreFromRemovingStones/MaximumScoreFromRemovingStones.cpp)|Medium| |1752|[Check if Array Is Sorted and Rotated](https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/) | [C++](./algorithms/cpp/checkIfArrayIsSortedAndRotated/CheckIfArrayIsSortedAndRotated.cpp)|Easy| |1751|[Maximum Number of Events That Can Be Attended II](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended-ii/) | [C++](./algorithms/cpp/maximumNumberOfEventsThatCanBeAttended/MaximumNumberOfEventsThatCanBeAttended.II.cpp)|Hard| |1750|[Minimum Length of String After Deleting Similar Ends](https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends/) | [C++](./algorithms/cpp/minimumLengthOfStringAfterDeletingSimilarEnds/MinimumLengthOfStringAfterDeletingSimilarEnds.cpp)|Medium| |1749|[Maximum Absolute Sum of Any Subarray](https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray/) | [C++](./algorithms/cpp/maximumAbsoluteSumOfAnySubarray/MaximumAbsoluteSumOfAnySubarray.cpp)|Medium| |1748|[Sum of Unique Elements](https://leetcode.com/problems/sum-of-unique-elements/) | [C++](./algorithms/cpp/sumOfUniqueElements/SumOfUniqueElements.cpp)|Easy| |1743|[Restore the Array From Adjacent Pairs](https://leetcode.com/problems/restore-the-array-from-adjacent-pairs/) | [C++](./algorithms/cpp/restoreTheArrayFromAdjacentPairs/RestoreTheArrayFromAdjacentPairs.cpp)|Medium| |1742|[Maximum Number of Balls in a Box](https://leetcode.com/problems/maximum-number-of-balls-in-a-box/) | [C++](./algorithms/cpp/maximumNumberOfBallsInABox/MaximumNumberOfBallsInABox.cpp)|Easy| |1739|[Building Boxes](https://leetcode.com/problems/building-boxes/) | [C++](./algorithms/cpp/buildingBoxes/BuildingBoxes.cpp)|Hard| |1738|[Find Kth Largest XOR Coordinate Value](https://leetcode.com/problems/find-kth-largest-xor-coordinate-value/) | [C++](./algorithms/cpp/findKthLargestXorCoordinateValue/FindKthLargestXorCoordinateValue.cpp)|Medium| |1736|[Latest Time by Replacing Hidden Digits](https://leetcode.com/problems/latest-time-by-replacing-hidden-digits/) | [C++](./algorithms/cpp/latestTimeByReplacingHiddenDigits/LatestTimeByReplacingHiddenDigits.cpp)|Easy| |1734|[Decode XORed Permutation](https://leetcode.com/problems/decode-xored-permutation/) | [C++](./algorithms/cpp/decodeXORedPermutation/DecodeXoredPermutation.cpp)|Medium| |1733|[Minimum Number of People to Teach](https://leetcode.com/problems/minimum-number-of-people-to-teach/) | [C++](./algorithms/cpp/minimumNumberOfPeopleToTeach/MinimumNumberOfPeopleToTeach.cpp)|Medium| |1732|[Find the Highest Altitude](https://leetcode.com/problems/find-the-highest-altitude/) | [C++](./algorithms/cpp/findTheHighestAltitude/FindTheHighestAltitude.cpp)|Easy| |1727|[Largest Submatrix With Rearrangements](https://leetcode.com/problems/largest-submatrix-with-rearrangements/) | [C++](./algorithms/cpp/largestSubmatrixWithRearrangements/LargestSubmatrixWithRearrangements.cpp)|Medium| |1726|[Tuple with Same Product](https://leetcode.com/problems/tuple-with-same-product/) | [C++](./algorithms/cpp/tupleWithSameProduct/TupleWithSameProduct.cpp)|Medium| |1725|[Number Of Rectangles That Can Form The Largest Square](https://leetcode.com/problems/number-of-rectangles-that-can-form-the-largest-square/) | [C++](./algorithms/cpp/numberOfRectanglesThatCanFormTheLargestSquare/NumberOfRectanglesThatCanFormTheLargestSquare.cpp)|Easy| |1718|[Construct the Lexicographically Largest Valid Sequence](https://leetcode.com/problems/construct-the-lexicographically-largest-valid-sequence/) | [C++](./algorithms/cpp/constructTheLexicographicallyLargestValidSequence/ConstructTheLexicographicallyLargestValidSequence.cpp)|Medium| |1717|[Maximum Score From Removing Substrings](https://leetcode.com/problems/maximum-score-from-removing-substrings/) | [C++](./algorithms/cpp/maximumScoreFromRemovingSubstrings/MaximumScoreFromRemovingSubstrings.cpp)|Medium| |1716|[Calculate Money in Leetcode Bank](https://leetcode.com/problems/calculate-money-in-leetcode-bank/) | [C++](./algorithms/cpp/calculateMoneyInLeetcodeBank/CalculateMoneyInLeetcodeBank.cpp)|Easy| |1712|[Ways to Split Array Into Three Subarrays](https://leetcode.com/problems/ways-to-split-array-into-three-subarrays/) | [C++](./algorithms/cpp/waysToSplitArrayIntoThreeSubarrays/WaysToSplitArrayIntoThreeSubarrays.cpp)|Medium| |1711|[Count Good Meals](https://leetcode.com/problems/count-good-meals/) | [C++](./algorithms/cpp/countGoodMeals/CountGoodMeals.cpp)|Medium| |1710|[Maximum Units on a Truck](https://leetcode.com/problems/maximum-units-on-a-truck/) | [C++](./algorithms/cpp/maximumUnitsOnATruck/MaximumUnitsOnATruck.cpp)|Easy| |1700|[Number of Students Unable to Eat Lunch](https://leetcode.com/problems/number-of-students-unable-to-eat-lunch/) | [C++](./algorithms/cpp/numberOfStudentsUnableToEatLunch/NumberOfStudentsUnableToEatLunch.cpp)|Easy| |1695|[Maximum Erasure Value](https://leetcode.com/problems/maximum-erasure-value/) | [C++](./algorithms/cpp/maximumErasureValue/MaximumErasureValue.cpp)|Medium| |1694|[Reformat Phone Number](https://leetcode.com/problems/reformat-phone-number/) | [C++](./algorithms/cpp/reformatPhoneNumber/ReformatPhoneNumber.cpp)|Easy| |1625|[Lexicographically Smallest String After Applying Operations](https://leetcode.com/problems/lexicographically-smallest-string-after-applying-operations/) | [C++](./algorithms/cpp/lexicographicallySmallestStringAfterApplyingOperations/LexicographicallySmallestStringAfterApplyingOperations.cpp)|Medium| |1624|[Largest Substring Between Two Equal Characters](https://leetcode.com/problems/largest-substring-between-two-equal-characters/) | [C++](./algorithms/cpp/largestSubstringBetweenTwoEqualCharacters/LargestSubstringBetweenTwoEqualCharacters.cpp)|Easy| |1605|[Find Valid Matrix Given Row and Column Sums](https://leetcode.com/problems/find-valid-matrix-given-row-and-column-sums/) | [C++](./algorithms/cpp/FindValidMatrixGivenRowAndColumnSums/FindValidMatrixGivenRowAndColumnSums.cpp)|Medium| |1573|[Number of Ways to Split a String](https://leetcode.com/problems/number-of-ways-to-split-a-string/) | [C++](./algorithms/cpp/NumberOfWaysToSplitString/NumberOfWaysToSplitString.cpp)|Medium| |1556|[Thousand Separator](https://leetcode.com/problems/thousand-separator/) | [C++](./algorithms/cpp/thousandSeparator/ThousandSeparator.cpp)|Easy| |1551|[Minimum Operations to Make Array Equal](https://leetcode.com/problems/minimum-operations-to-make-array-equal/) | [C++](./algorithms/cpp/minimumOperationsToMakeArrayEqual/MinimumOperationsToMakeArrayEqual.cpp)|Medium| |1550|[Three Consecutive Odds](https://leetcode.com/problems/three-consecutive-odds/) | [C++](./algorithms/cpp/threeConsecutiveOdds/ThreeConsecutiveOdds.cpp)|Easy| |1541|[Minimum Insertions to Balance a Parentheses String](https://leetcode.com/problems/minimum-insertions-to-balance-a-parentheses-string/) | [C++](./algorithms/cpp/minimumInsertionsToBalanceAParenthesesString/MinimumInsertionsToBalanceAParenthesesString.cpp)|Medium| |1535|[Find the Winner of an Array Game](https://leetcode.com/problems/find-the-winner-of-an-array-game/) | [C++](./algorithms/cpp/findTheWinnerOfAnArrayGame/FindTheWinnerOfAnArrayGame.cpp)|Medium| |1529|[Bulb Switcher IV](https://leetcode.com/problems/bulb-switcher-iv/) | [C++](./algorithms/cpp/bulbSwitcher/BulbSwitcher.IV.cpp)|Medium| |1528|[Shuffle String](https://leetcode.com/problems/shuffle-string/submissions/) | [C++](./algorithms/cpp/shuffleString/ShuffleString.cpp)|Easy| |1525|[Number of Good Ways to Split a String](https://leetcode.com/problems/number-of-good-ways-to-split-a-string/) | [C++](./algorithms/cpp/numberOfGoodWaysToSplitAString/NumberOfGoodWaysToSplitAString.cpp)|Medium| |1524|[Number of Sub-arrays With Odd Sum](https://leetcode.com/problems/number-of-sub-arrays-with-odd-sum/) | [C++](./algorithms/cpp/numberOfSubArraysWithOddSum/NumberOfSubArraysWithOddSum.cpp)|Medium| |1523|[Count Odd Numbers in an Interval Range](https://leetcode.com/problems/count-odd-numbers-in-an-interval-range/) | [C++](./algorithms/cpp/countOddNumbersInAnIntervalRange/CountOddNumbersInAnIntervalRange.cpp)|Easy| |1513|[Number of Substrings With Only 1s](https://leetcode.com/problems/number-of-substrings-with-only-1s/) | [C++](./algorithms/cpp/numberOfSubstringsWithOnly1s/NumberOfSubstringsWithOnly1s.cpp)|Medium| |1470|[Shuffle the Array](https://leetcode.com/problems/shuffle-the-array/) | [C++](./algorithms/cpp/shuffleTheArray/ShuffleTheArray.cpp)|Easy| |1464|[Maximum Product of Two Elements in an Array](https://leetcode.com/problems/maximum-product-of-two-elements-in-an-array/) | [C++](./algorithms/cpp/maximumProductOfTwoElementsInAnArray/MaximumProductOfTwoElementsInAnArray.cpp)|Easy| |1460|[Make Two Arrays Equal by Reversing Sub-arrays](https://leetcode.com/problems/make-two-arrays-equal-by-reversing-sub-arrays/) | [C++](./algorithms/cpp/twoArraysEqualByReversingSubArrays/MakeTwoArraysEqualByReversingSubArrays.cpp)|Easy| |1376|[Time Needed to Inform All Employees](https://leetcode.com/problems/time-needed-to-inform-all-employees/) | [C++](./algorithms/cpp/timeNeededToInformAllEmployees/TimeNeededToInformAllEmployees.cpp)|Medium| |1375|[Bulb Switcher III](https://leetcode.com/problems/bulb-switcher-iii) | [C++](./algorithms/cpp/bulbSwitcher/BulbSwitcher.III.cpp)|Medium| |1353|[Maximum Number of Events That Can Be Attended](https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended/) | [C++](./algorithms/cpp/maximumNumberOfEventsThatCanBeAttended/MaximumNumberOfEventsThatCanBeAttended.cpp)|Medium| |1333|[Filter Restaurants by Vegan-Friendly, Price and Distance](https://leetcode.com/problems/filter-restaurants-by-vegan-friendly-price-and-distance/) | [C++](./algorithms/cpp/filterRestaurantsByVeganFriendlyPriceAndDistance/FilterRestaurantsByVeganFriendlyPriceAndDistance.cpp)|Medium| |1207|[Unique Number of Occurrences](https://leetcode.com/problems/unique-number-of-occurrences/) | [C++](./algorithms/cpp/uniqueNumberOfOccurrences/Unique-Number-of-Occurrences.cpp)|Easy| |1170|[Compare Strings by Frequency of the Smallest Character](https://leetcode.com/problems/compare-strings-by-frequency-of-the-smallest-character/) | [C++](./algorithms/cpp/compareStringsByFrequencyOfTheSmallestCharacter/CompareStringsByFrequencyOfTheSmallestCharacter.cpp)|Easy| |1071|[Greatest Common Divisor of Strings](https://leetcode.com/problems/greatest-common-divisor-of-strings/) | [C++](./algorithms/cpp/greatestCommonDivisorOfStrings/GreatestCommonDivisorOfStrings.cpp)|Easy| |1030|[Matrix Cells in Distance Order](https://leetcode.com/problems/matrix-cells-in-distance-order/) | [C++](./algorithms/cpp/matrixCellsInDistanceOrder/MatrixCellsInDistanceOrder.cpp)|Easy| |1029|[Two City Scheduling](https://leetcode.com/problems/two-city-scheduling/) | [C++](./algorithms/cpp/twoCityScheduling/TwoCityScheduling.cpp)|Easy| |1028|[Recover a Tree From Preorder Traversal](https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/) | [C++](./algorithms/cpp/recoverATreeFromPreorderTraversal/recoverATreeFromPreorderTraversal.cpp)|Hard| |1024|[Video Stitching](https://leetcode.com/problems/video-stitching/) | [C++](./algorithms/cpp/videoStitching/VideoStitching.cpp)|Medium| |993|[Cousins in Binary Tree](https://leetcode.com/problems/cousins-in-binary-tree/) | [C++](./algorithms/cpp/cousinsInBinaryTree/CousinsInBinaryTree.cpp)|Easy| |991|[Broken Calculator](https://leetcode.com/problems/broken-calculator/) | [C++](./algorithms/cpp/brokenCalculator/BrokenCalculator.cpp)|Medium| |990|[Satisfiability of Equality Equations](https://leetcode.com/problems/satisfiability-of-equality-equations/) | [C++](./algorithms/cpp/satisfiabilityOfEqualityEquations/SatisfiabilityOfEqualityEquations.cpp)|Medium| |989|[Add to Array-Form of Integer](https://leetcode.com/problems/add-to-array-form-of-integer/) | [C++](./algorithms/cpp/addToArrayFormOfInteger/AddToArrayFormOfInteger.cpp)|Easy| |988|[Smallest String Starting From Leaf](https://leetcode.com/problems/smallest-string-starting-from-leaf/) | [C++](./algorithms/cpp/smallestStringStartingFromLeaf/SmallestStringStartingFromLeaf.cpp)|Medium| |987|[Vertical Order Traversal of a Binary Tree](https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/) | [C++](./algorithms/cpp/verticalOrderTraversalOfABinaryTree/VerticalOrderTraversalOfABinaryTree.cpp)|Medium| |986|[Interval List Intersections](https://leetcode.com/problems/interval-list-intersections/) | [C++](./algorithms/cpp/intervalListIntersectons/IntervalListIntersections.cpp)|Medium| |985|[Sum of Even Numbers After Queries](https://leetcode.com/problems/sum-of-even-numbers-after-queries/) | [C++](./algorithms/cpp/sumOfEvenNumbersAfterQueries/SumOfEvenNumbersAfterQueries.cpp)|Easy| |984|[String Without AAA or BBB](https://leetcode.com/problems/string-without-aaa-or-bbb/) | [C++](./algorithms/cpp/stringWithoutAAAOrBBB/StringWithoutAAAOrBBB.cpp)|Easy| |983|[Minimum Cost For Tickets](https://leetcode.com/problems/minimum-cost-for-tickets/) | [C++](./algorithms/cpp/minimumCostForTickets/MinimumCostForTickets.cpp)|Medium| |982|[Triples with Bitwise AND Equal To Zero](https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/) | [C++](./algorithms/cpp/triplesWithBitwiseANDEqualToZero/TriplesWithBitwiseAndEqualToZero.cpp)|Hard| |981|[Time Based Key-Value Store](https://leetcode.com/problems/time-based-key-value-store/) | [C++](./algorithms/cpp/timeBasedKeyValueStore/TimeBasedKeyValueStore.cpp)|Medium| |980|[Unique Paths III](https://leetcode.com/problems/unique-paths-iii/) | [C++](./algorithms/cpp/uniquePaths/UniquePaths.III.cpp),[Python](./algorithms/python/uniquePaths/uniquePathsIII.py)|Hard| |979|[Distribute Coins in Binary Tree](https://leetcode.com/problems/distribute-coins-in-binary-tree/) | [C++](./algorithms/cpp/distributeCoinsInBinaryTree/DistributeCoinsInBinaryTree.cpp)|Medium| |978|[Longest Turbulent Subarray](https://leetcode.com/problems/longest-turbulent-subarray/) | [C++](./algorithms/cpp/longestTurbulentSubarray/LongestTurbulentSubarray.cpp),[Python](./algorithms/python/LongestTurbulentSubarray/maxTurbulenceSize.py)|Medium| |977|[Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/) | [C++](./algorithms/cpp/squaresOfASortedArray/SquaresOfASortedArray.cpp), [Python](./algorithms/python/SquaresOfSortedArray/sortedSquares.py)|Easy| |976|[Largest Perimeter Triangle](https://leetcode.com/problems/largest-perimeter-triangle/) | [C++](./algorithms/cpp/largestPerimeterTriangle/largestPerimeterTriangle.cpp), [Python](./algorithms/python/LargestPerimeterTriangle/largestPerimeter.py)|Easy| |971|[Flip Binary Tree To Match Preorder Traversal](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/) | [Python](./algorithms/python/FlipBinaryTreeToMatchPreorderTraversal/flipMatchVoyage.py)|Medium| |969|[Pancake Sorting](https://leetcode.com/problems/pancake-sorting/) | [Python](./algorithms/python/PancakeSorting/pancakeSort.py)|Medium| |961|[N-Repeated element in size 2N Array](https://leetcode.com/problems/n-repeated-element-in-size-2n-array/) | [C++](./algorithms/cpp/nRepeatedElementInSize2NArray/N-Repeated-Element-in-Size-2N-Array.cpp)|Easy| |958|[Check Completeness of a Binary Tree](https://leetcode.com/problems/check-completeness-of-a-binary-tree/) | [Python](./algorithms/python/CheckCompletenessOfABinaryTree/isCompleteTree.py)|Medium| |951|[Flip Equivalent Binary Trees](https://leetcode.com/problems/flip-equivalent-binary-trees/) | [Python](./algorithms/python/FlipEquivalentBinaryTrees/flipEquiv.py)|Medium| |950|[Reveal Cards In Increasing Order](https://leetcode.com/problems/reveal-cards-in-increasing-order/) | [Python](./algorithms/python/RevealCardsInIncreasingOrder/deckRevealedIncreasing.py)|Medium| |941|[Valid Mountain Array](https://leetcode.com/problems/valid-mountain-array/) | [Python](./algorithms/python/ValidMountainArray/validMountainArray.py)|Easy| |933|[Number of Recent Calls](https://leetcode.com/problems/number-of-recent-calls/) | [C++](./algorithms/cpp/numberOfRecentCalls/NumberOfRecentCalls.cpp)|Easy| |931|[Minimum Falling Path Sum](https://leetcode.com/problems/minimum-falling-path-sum/) | [C++](./algorithms/cpp/minimumFallingPathSum/MinimumFallingPathSum.cpp)|Medium| |929|[Unique Email Addresses](https://leetcode.com/problems/unique-email-addresses/) | [C++](./algorithms/cpp/uniqueEmailAddresses/UniqueEmailAddresses.cpp)|Easy| |922|[Sort Array By Parity II](https://leetcode.com/problems/sort-array-by-parity-ii/) | [C++](./algorithms/cpp/sortArrayByParity/SortArrayByParity.II.cpp)|Easy| |914|[X of a Kind in a Deck of Cards](https://leetcode.com/problems/x-of-a-kind-in-a-deck-of-cards/) | [Python](./algorithms/python/XOfAKindInADeckOfCards/hasGroupsSizeX.py)|Easy| |905|[Sort Array By Parity](https://leetcode.com/problems/sort-array-by-parity/) | [C++](./algorithms/cpp/sortArrayByParity/SortArrayByParity.cpp)|Easy| |876|[Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list/) | [Python](./algorithms/python/MiddleOfTheLinkedList/middleOfTheLinkedList.py)|Easy| |859|[Buddy Strings](https://leetcode.com/problems/buddy-strings/description/) | [C++](./algorithms/cpp/buddyStrings/BuddyStrings.cpp)|Easy| |858|[Mirror Reflection](https://leetcode.com/problems/mirror-reflection/description/) | [C++](./algorithms/cpp/mirrorReflection/MirrorReflection.cpp)|Medium| |852|[Peak Index in a Mountain Array](https://leetcode.com/problems/peak-index-in-a-mountain-array/description/) | [C++](./algorithms/cpp/peakIndexInAMountainArray/PeakIndexInAMountainArray.cpp)|Easy| |849|[Maximize Distance to Closest Person](https://leetcode.com/problems/maximize-distance-to-closest-person/) | [Python](./algorithms/python/MaximizeDistanceToClosestPerson/maxDistToClosest.py)|Easy| |844|[Backspace String Compare](https://leetcode.com/problems/backspace-string-compare/description/) | [C++](./algorithms/cpp/backspaceStringCompare/BackspaceStringCompare.cpp)|Easy| |837|[Most Common Word](https://leetcode.com/problems/most-common-word/) | [C++](./algorithms/cpp/mostCommonWord/MostCommonWord.cpp)|Easy| |830|[Positions of Large Groups](https://leetcode.com/problems/positions-of-large-groups/) | [Python](./algorithms/python/PositionsOfLargeGroups/largeGroupPositions.py)|Easy| |820|[Short Encoding of Words](https://leetcode.com/problems/short-encoding-of-words/) | [C++](./algorithms/cpp/shortEncodingOfWords/ShortEncodingOfWords.cpp)|Medium| |804|[Unique Morse Code Words](https://leetcode.com/problems/unique-morse-code-words/description/) | [C++](./algorithms/cpp/uniqueMorseCodeWords/UniqueMorseCodeWords.cpp)|Easy| |776|[Swim In Rising Water](https://leetcode.com/problems/swim-in-rising-water/description/) | [Python](./algorithms/python/SwimInRisingWater/swim_in_rising_water.py)|Hard| |771|[Jewels and Stones](https://leetcode.com/problems/jewels-and-stones/description) | [C++](./algorithms/cpp/jewelsAndStones/JewelsAndStones.cpp)|Easy| |747|[Largest Number At Least Twice of Others](https://leetcode.com/problems/largest-number-at-least-twice-of-others/) | [Python](./algorithms/python/LargestNumberAtLeastTwiceOfOthers/dominantIndex.py)|Easy| |746|[Min Cost Climbing Stairs](https://leetcode.com/problems/min-cost-climbing-stairs/) | [C++](./algorithms/cpp/minCostClimbingStairs/MinCostClimbingStairs.cpp), [Python](./algorithms/python/MinCostClimbingStairs/minCostClimbingStairs.py)|Easy| |721|[Accounts Merge](https://leetcode.com/problems/accounts-merge/) | [C++](./algorithms/cpp/accountsMerge/AccountsMerge.cpp)|Medium| |717|[1-bit and 2-bit Characters](https://leetcode.com/problems/1-bit-and-2-bit-characters/) | [Python](./algorithms/python/1-bitAnd2-bitCharacters/isOneBitCharacter.py)|Easy| |714|[Best Time to Buy and Sell Stock with Transaction Fee](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee) | [C++](./algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithTransactionFee.cpp)|Medium| |712|[Minimum ASCII Delete Sum for Two Strings](https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/) | [C++](./algorithms/cpp/minimumASCIIDeleteSumForTwoStrings/MinimumAsciiDeleteSumForTwoStrings.cpp)|Medium| |695|[Max Area of Island](https://leetcode.com/problems/max-area-of-island/) | [C++](./algorithms/cpp/maxAreaOfIsland/MaxAreaOfIsland.cpp)|Medium| |687|[Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [Python](./algorithms/python/LongestUnivaluePath/longestUnivaluePath.py)|Easy| |684|[Redundant Connection](https://leetcode.com/problems/redundant-connection/) | [Python](./algorithms/python/RedundantConnection/findRedundantConnection.py)|Medium| |674|[Longest Continuous Increasing Subsequence](https://leetcode.com/problems/longest-continuous-increasing-subsequence/) | [Python](./algorithms/python/LongestContinuousIncreasingSubsequence/findLengthOfLCIS.py)|Easy| |672|[Bulb Switcher II](https://leetcode.com/problems/bulb-switcher-ii/submissions/) | [C++](./algorithms/cpp/bulbSwitcher/BulbSwitcher.II.cpp)|Medium| |671|[Second Minimum Node In a Binary Tree](https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/) | [Python](./algorithms/python/SecondMinimumNodeInABinaryTree/findSecondMinimumValue.py)|Easy| |665|[Non-decreasing Array](https://leetcode.com/problems/non-decreasing-array/) | [Python](./algorithms/python/Non-decreasingArray/checkPossibility.py)|Easy| |662|[Maximum Width of Binary Tree](https://leetcode.com/problems/maximum-width-of-binary-tree/) | [Python](./algorithms/python/MaximumWidthOfBinaryTree/widthOfBinaryTree.py)|Medium| |661|[Image Smoother](https://leetcode.com/problems/image-smoother/) | [Python](./algorithms/python/ImageSmoother/imageSmoother.py)|Easy| |655|[Print Binary Tree](https://leetcode.com/problems/print-binary-tree/) | [Python](./algorithms/python/PrintBinaryTree/printTree.py)|Medium| |652|[Find Duplicate Subtrees](https://leetcode.com/problems/find-duplicate-subtrees/) | [Python](./algorithms/python/FindDuplicateSubtrees/findDuplicateSubtrees.py)|Medium| |647|[Palindromic Substrings](https://leetcode.com/problems/palindromic-substrings/) | [C++](./algorithms/cpp/palindromicSubstrings/PalindromicSubstrings.cpp)|Medium| |643|[Maximum Average Subarray I](https://leetcode.com/problems/maximum-average-subarray-i/description/) | [C++](./algorithms/cpp/maximumAverageSubarray/MaximumAverageSubarray.I.cpp), [Python](./algorithms/python/MaximumAverageSubarrayI/findMaxAverage.py)|Easy| |628|[Maximum Product of Three Numbers](https://leetcode.com/problems/maximum-product-of-three-numbers/) | [Python](./algorithms/python/MaximumProductOfThreeNumbers/maximumProduct.py)|Easy| |623|[Add One Row to Tree](https://leetcode.com/problems/add-one-row-to-tree/) | [Python](./algorithms/python/AddOneRowToTree/addOneRow.py)|Medium| |581|[Shortest Unsorted Continuous Subarray](https://leetcode.com/problems/shortest-unsorted-continuous-subarray/) | [Python](./algorithms/python/ShortestUnsortedContinuousSubarray/findUnsortedSubarray.py)|Easy| |572|[Subtree of Another Tree](https://leetcode.com/problems/subtree-of-another-tree/) | [Python](./algorithms/python/SubtreeOfAnotherTree/isSubtree.py)|Easy| |563|[Binary Tree Tilt](https://leetcode.com/problems/binary-tree-tilt/) | [Python](./algorithms/python/BinaryTreeTilt/findTilt.py)|Easy| |547|[Friend Circles](https://leetcode.com/problems/friend-circles/) | [C++](./algorithms/cpp/friendCircles/FriendCircles.cpp)|Medium| |543|[Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/) | [C++](./algorithms/cpp/diameterOfBinaryTree/diameterOfBinaryTree.cpp), [Python](./algorithms/python/DiameterOfBinaryTree/diameterOfBinaryTree.py)|Easy| |538|[Convert BST to Greater Tree](https://leetcode.com/problems/convert-bst-to-greater-tree/) | [Python](./algorithms/python/ConvertBSTtoGreaterTree/convertBST.py)|Easy| |532|[K-diff Pairs in an Array](https://leetcode.com/problems/k-diff-pairs-in-an-array/) | [Python](./algorithms/python/K-diffPairsInAnArray/findPairs.py)|Easy| |520|[Detect Capital](https://leetcode.com/problems/detect-capital/) | [C++](./algorithms/cpp/detectCapital/DetectCapital.cpp)|Easy| |518|[Coin Change 2](https://leetcode.com/problems/coin-change-2/) | [C++](./algorithms/cpp/coinChange/CoinChange2.cpp)|Medium| |516|[Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [C++](./algorithms/cpp/longestPalindromicSubsequence/LongestPalindromicSubsequence.cpp)|Medium| |509|[Fibonacci Number](https://leetcode.com/problems/fibonacci-number/) | [C++](./algorithms/cpp/fibonacciNumber/FibonacciNumber.cpp), [Python](./algorithms/python/FibonacciNumber/fib.py)|Easy| |497|[Random Point in Non-overlapping Rectangles](https://leetcode.com/problems/random-point-in-non-overlapping-rectangles/) | [C++](./algorithms/cpp/randomPointInNonOverlappingRectangles/randomPointInNonOverlappingRectangles.cpp)|Medium| |494|[Target Sum](https://leetcode.com/problems/target-sum/) | [C++](./algorithms/cpp/targetSum/targetSum.cpp)|Medium| |477|[Total Hamming Distance](https://leetcode.com/problems/total-hamming-distance/) | [C++](./algorithms/cpp/totalHammingDistance/totalHammingDistance.cpp)|Medium| |463|[Island Perimeter](https://leetcode.com/problems/island-perimeter/) | [C++](./algorithms/cpp/islandPerimeter/IslandPerimeter.cpp)|Easy| |450|[DeleteNodeInABST](https://leetcode.com/problems/delete-node-in-a-bst/) | [Python](./algorithms/python/DeleteNodeInABST/deleteNode.py)|Medium| |449|[Serialize and Deserialize BST](https://leetcode.com/problems/serialize-and-deserialize-bst/) | [Python](./algorithms/python/SerializeAndDeserializeBST/serialize.py)|Medium| |438|[Find all Anagrams in a string](https://leetcode.com/problems/find-all-anagrams-in-a-string/) | [C++](./algorithms/cpp/findAllAnagramsInAString/Find-All-Anagrams-in-a-String.cpp)|Medium| |437|[Path Sum III](https://leetcode.com/problems/path-sum-iii/) | [Python](./algorithms/python/PathSumIII/pathSum.py)|Medium| |418|[SentenceScreenFitting](https://leetcode.com/problems/sentence-screen-fitting/) 🔒 | [C++](./algorithms/cpp/sentenceScreenFitting/sentenceScreenFitting.cpp)|Easy| |416|[Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/description/) | [C++](./algorithms/cpp/partitionEqualSubsetSum/PartitionEqualSubsetSum.cpp)|Medium| |415|[Add Strings](https://leetcode.com/problems/add-strings/) | [C++](./algorithms/cpp/addStrings/AddStrings.cpp)|Easy| |414|[Third Maximum Number](https://leetcode.com/problems/third-maximum-number/) | [C++](./algorithms/cpp/thirdMaximumNumber/ThirdMaximumNumber.cpp), [Python](./algorithms/python/ThirdMaximumNumber/thirdMax.py)|Easy| |413|[Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [C++](./algorithms/cpp/arithmeticSlices/ArithmeticSlices.cpp)|Medium| |412|[Fizz Buzz](https://leetcode.com/problems/fizz-buzz/) | [C++](./algorithms/cpp/fizzBuzz/FizzBuzz.cpp)|Easy| |410|[Split Array Largest Sum](https://leetcode.com/problems/split-array-largest-sum/) | [C++](./algorithms/cpp/splitArrayLargestSum/SplitArrayLargestSum.cpp)|Hard| |409|[Longest Palindrome](https://leetcode.com/problems/longest-palindrome/) | [C++](./algorithms/cpp/longestPalindrome/LongestPalindrome.cpp)|Easy| |406|[Queue Reconstruction by Height](https://leetcode.com/problems/queue-reconstruction-by-height/) | [C++](./algorithms/cpp/queueReconstructionByHeight/QueueReconstructionByHeight.cpp)|Medium| |405|[Convert a Number to Hexadecimal](https://leetcode.com/problems/convert-a-number-to-hexadecimal/) | [C++](./algorithms/cpp/convertANumberToHexadecimal/ConvertANumberToHexadecimal.cpp)|Easy| |404|[Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [C++](./algorithms/cpp/sumOfLeftLeaves/SumOfLeftLeaves.cpp), [Python](./algorithms/python/SumOfLeftLeaves/sumOfLeftLeaves.py)|Easy| |403|[Frog Jump](https://leetcode.com/problems/frog-jump/) | [C++](./algorithms/cpp/frogJump/FrogJump.cpp)|Hard| |402|[Remove K Digits](https://leetcode.com/problems/remove-k-digits/) | [C++](./algorithms/cpp/removeKDigits/RemoveKDigits.cpp)|Medium| |401|[Binary Watch](https://leetcode.com/problems/binary-watch/) | [C++](./algorithms/cpp/binaryWatch/BinaryWatch.cpp)|Easy| |400|[Nth Digit](https://leetcode.com/problems/nth-digit/) | [C++](./algorithms/cpp/nthDigit/NthDigit.cpp)|Medium| |399|[Evaluate Division](https://leetcode.com/problems/evaluate-division/) | [C++](./algorithms/cpp/evaluateDivision/EvaluateDivision.cpp)|Medium| |398|[Random Pick Index](https://leetcode.com/problems/random-pick-index/) | [C++](./algorithms/cpp/randomPickIndex/RandomPickIndex.cpp)|Medium| |397|[Integer Replacement](https://leetcode.com/problems/integer-replacement/) | [C++](./algorithms/cpp/integerReplacement/IntegerReplacement.cpp)|Medium| |396|[Rotate Function](https://leetcode.com/problems/rotate-function/) | [C++](./algorithms/cpp/rotateFunction/RotateFunction.cpp)|Easy| |395|[Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [C++](./algorithms/cpp/longestSubstringWithAtLeastKRepeatingCharacters/LongestSubstringWithAtLeastKRepeatingCharacters.cpp)|Medium| |394|[Decode String](https://leetcode.com/problems/decode-string/) | [C++](./algorithms/cpp/decodeString/DecodeString.cpp)|Medium| |393|[UTF-8 Validation](https://leetcode.com/problems/utf-8-validation/) | [C++](./algorithms/cpp/UTF8Validation/UTF8Validation.cpp)|Medium| |392|[Is Subsequence](https://leetcode.com/problems/is-subsequence/) | [C++](./algorithms/cpp/isSubsequence/IsSubsequence.cpp)|Medium| |391|[Perfect Rectangle](https://leetcode.com/problems/perfect-rectangle/) | [C++](./algorithms/cpp/perfectRectangle/PerfectRectangle.cpp)|Hard| |390|[Elimination Game](https://leetcode.com/problems/elimination-game/) | [C++](./algorithms/cpp/eliminationGame/EliminationGame.cpp)|Medium| |389|[Find the Difference](https://leetcode.com/problems/find-the-difference/) | [C++](./algorithms/cpp/findTheDifference/FindTheDifference.cpp)|Easy| |388|[Longest Absolute File Path](https://leetcode.com/problems/longest-absolute-file-path/) | [C++](./algorithms/cpp/longestAbsoluteFilePath/LongestAbsoluteFilePath.cpp)|Medium| |387|[First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string/) | [C++](./algorithms/cpp/firstUniqueCharacterInAString/FirstUniqueCharacterInAString.cpp)|Easy| |386|[Lexicographical Numbers](https://leetcode.com/problems/lexicographical-numbers/) | [C++](./algorithms/cpp/lexicographicalNumbers/LexicographicalNumbers.cpp)|Medium| |385|[Mini Parser](https://leetcode.com/problems/mini-parser/) | [C++](./algorithms/cpp/miniParser/MiniParser.cpp)|Medium| |384|[Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [C++](./algorithms/cpp/shuffleAnArray/ShuffleAnArray.cpp)|Medium| |383|[Ransom Note](https://leetcode.com/problems/ransom-note/) | [C++](./algorithms/cpp/ransomNote/RansomNote.cpp)|Easy| |382|[Linked List Random Node](https://leetcode.com/problems/linked-list-random-node/) | [C++](./algorithms/cpp/linkedListRandomNode/LinkedListRandomNode.cpp)|Medium| |381|[Insert Delete GetRandom O(1) - Duplicates allowed](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/) | [C++](./algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1DuplicatesAllowed.cpp)|Hard| |380|[Insert Delete GetRandom O(1)](https://leetcode.com/problems/insert-delete-getrandom-o1/) | [C++](./algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1.cpp)|Hard| |377|[Combination Sum IV](https://leetcode.com/problems/combination-sum-iv/) | [C++](./algorithms/cpp/combinationSumIV/combinationSumIV.cpp)|Medium| |376|[Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [C++](./algorithms/cpp/wiggleSubsequence/wiggleSubsequence.cpp)|Medium| |371|[Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/description/) | [C++](./algorithms/cpp/sumOfTwoIntegers/SumOfTwoIntegers.cpp)|Easy| |367|[Valid Perfect Square](https://leetcode.com/problems/valid-perfect-square/description/) | [C++](./algorithms/cpp/validPerfectSquare/ValidPerfectSquare.cpp)|Easy| |357|[Count Numbers with Unique Digits](https://leetcode.com/problems/count-numbers-with-unique-digits/) | [C++](./algorithms/cpp/countNumbersWithUniqueDigits/CountNumbersWithUniqueDigits.cpp)|Medium| |350|[Intersection of Two Arrays II](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [C++](./algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArraysII.cpp)|Easy| |349|[Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [C++](./algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArrays.cpp)|Easy| |347|[Top K Frequent Elements](https://leetcode.com/problems/top-k-frequent-elements/) | [C++](./algorithms/cpp/topKFrequentElements/topKFrequentElements.cpp)|Medium| |345|[Reverse Vowels of a String](https://leetcode.com/problems/reverse-vowels-of-a-string/) | [C++](./algorithms/cpp/reverseVowelsOfAString/reverseVowelsOfAString.cpp)|Easy| |344|[Reverse String](https://leetcode.com/problems/reverse-string/) | [C++](./algorithms/cpp/reverseString/ReverseString.cpp)|Easy| |343|[Integer Break](https://leetcode.com/problems/integer-break/) | [C++](./algorithms/cpp/integerBreak/IntegerBreak.cpp)|Medium| |342|[Power of Four](https://leetcode.com/problems/power-of-four/) | [C++](./algorithms/cpp/powerOfFour/PowerOfFour.cpp)|Easy| |341|[Flatten Nested List Iterator](https://leetcode.com/problems/flatten-nested-list-iterator/) | [C++](./algorithms/cpp/flattenNestedListIterator/FlattenNestedListIterator.cpp)|Medium| |338|[Counting Bits](https://leetcode.com/problems/counting-bits/) | [C++](./algorithms/cpp/countingBits/CountingBits.cpp)|Medium| |337|[House Robber III](https://leetcode.com/problems/house-robber-iii/) | [C++](./algorithms/cpp/houseRobber/houseRobberIII.cpp), [Python](./algorithms/python/HouseRobberIII/rob.py)|Medium| |336|[Palindrome Pairs](https://leetcode.com/problems/palindrome-pairs/) | [C++](./algorithms/cpp/palindromePairs/PalindromePairs.cpp)|Hard| |334|[Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [C++](./algorithms/cpp/increasingTripletSubsequence/increasingTripletSubsequence.cpp)|Medium| |332|[Reconstruct Itinerary](https://leetcode.com/problems/reconstruct-itinerary/) | [C++](./algorithms/cpp/reconstructItinerary/ReconstructItinerary.cpp)|Medium| |331|[Verify Preorder Serialization of a Binary Tree](https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/) | [C++](./algorithms/cpp/verifyPreorderSerializationOfABinaryTree/VerifyPreorderSerializationOfABinaryTree.cpp)|Medium| |330|[Patching Array](https://leetcode.com/problems/patching-array/) | [C++](./algorithms/cpp/patchingArray/PatchingArray.cpp)|Medium| |329|[Longest Increasing Path in a Matrix](https://leetcode.com/problems/longest-increasing-path-in-a-matrix/) | [C++](./algorithms/cpp/longestIncreasingPathInAMatrix/LongestIncreasingPathInAMatrix.cpp)|Medium| |328|[Odd Even Linked List](https://leetcode.com/problems/odd-even-linked-list/) | [C++](./algorithms/cpp/oddEvenLinkedList/OddEvenLinkedList.cpp)|Easy| |327|[Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [C++](./algorithms/cpp/countOfRangeSum/CountOfRangeSum.cpp)|Hard| |326|[Power of Three](https://leetcode.com/problems/power-of-three/) | [C++](./algorithms/cpp/powerOfThree/PowerOfThree.cpp)|Easy| |324|[Wiggle Sort II](https://leetcode.com/problems/wiggle-sort-ii/) | [C++](./algorithms/cpp/wiggleSort/WiggleSort.II.cpp)|Medium| |322|[Coin Change](https://leetcode.com/problems/coin-change/) | [C++](./algorithms/cpp/coinChange/coinChange.cpp)|Medium| |321|[Create Maximum Number](https://leetcode.com/problems/create-maximum-number/) | [C++](./algorithms/cpp/createMaximumNumber/CreateMaximumNumber.cpp)|Hard| |319|[Bulb Switcher](https://leetcode.com/problems/bulb-switcher/) | [C++](./algorithms/cpp/bulbSwitcher/bulbSwitcher.cpp)|Medium| |318|[Maximum Product of Word Lengths](https://leetcode.com/problems/maximum-product-of-word-lengths/) | [C++](./algorithms/cpp/maximumProductOfWordLengths/MaximumProductOfWordLengths.cpp)|Medium| |316|[Remove Duplicate Letters](https://leetcode.com/problems/remove-duplicate-letters/) | [C++](./algorithms/cpp/removeDuplicateLetters/RemoveDuplicateLetters.cpp)|Hard| |315|[Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) | [C++](./algorithms/cpp/countOfSmallerNumbersAfterSelf/countOfSmallerNumbersAfterSelf.cpp)|Hard| |313|[Super Ugly Number](https://leetcode.com/problems/super-ugly-number/) | [C++](./algorithms/cpp/superUglyNumber/SuperUglyNumber.cpp)|Medium| |312|[Burst Balloons](https://leetcode.com/problems/burst-balloons/) | [C++](./algorithms/cpp/burstBalloons/BurstBalloons.cpp)|Hard| |310|[Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [C++](./algorithms/cpp/minimumHeightTrees/MinimumHeightTrees.cpp)|Medium| |309|[Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [C++](./algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithCooldown.cpp)|Medium| |307|[Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [C++](./algorithms/cpp/rangeSumQuery-Immutable/rangeSumQuery-Mutable/RangeSumQueryMutable.cpp)|Medium| |306|[Additive Number](https://leetcode.com/problems/additive-number/) | [C++](./algorithms/cpp/additiveNumber/AdditiveNumber.cpp)|Medium| |304|[Range Sum Query 2D - Immutable](https://leetcode.com/problems/range-sum-query-2d-immutable/) | [C++](./algorithms/cpp/rangeSumQuery2D-Immutable/RangeSumQuery2dImmutable.cpp)|Medium| |303|[Range Sum Query - Immutable](https://leetcode.com/problems/range-sum-query-immutable/) | [C++](./algorithms/cpp/rangeSumQuery-Immutable/rangeSumQuery-Immutable.cpp)|Easy| |301|[Remove Invalid Parentheses](https://leetcode.com/problems/remove-invalid-parentheses/) | [C++](./algorithms/cpp/removeInvalidParentheses/RemoveInvalidParentheses.cpp) |Hard| |300|[Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [C++](./algorithms/cpp/longestIncreasingSubsequence/longestIncreasingSubsequence.cpp)|Medium| |299|[Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [C++](./algorithms/cpp/bullsAndCows/bullsAndCows.cpp)|Easy| |297|[Serialize and Deserialize Binary Tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/) | [C++](./algorithms/cpp/serializeAndDeserializeBinaryTree/SerializeAndDeserializeBinaryTree.cpp)|Medium| |295|[Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [C++](./algorithms/cpp/findMedianFromDataStream/FindMedianFromDataStream.cpp)|Hard| |292|[Nim Game](https://leetcode.com/problems/nim-game/) | [C++](./algorithms/cpp/nimGame/nimGame.cpp)|Easy| |290|[Word Pattern](https://leetcode.com/problems/word-pattern/) | [C++](./algorithms/cpp/wordPattern/WordPattern.cpp)|Easy| |289|[Game of Life](https://leetcode.com/problems/game-of-life/) | [C++](./algorithms/cpp/gameOfLife/GameOfLife.cpp)|Medium| |287|[Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [C++](./algorithms/cpp/findTheDuplicateNumber/findTheDuplicateNumber.cpp), [Python](./algorithms/python/FindTheDuplicateNumber/findDuplicate.py)|Hard| |285|[Inorder Successor in BST](https://leetcode.com/problems/inorder-successor-in-bst/) 🔒 | [Java](./algorithms/java/src/inorderSuccessorInBST/inorderSuccessorInBST.java)|Medium| |284|[Peeking Iterator](https://leetcode.com/problems/peeking-iterator/) | [C++](./algorithms/cpp/peekingIterator/PeekingIterator.cpp)|Medium| |283|[Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [C++](./algorithms/cpp/moveZeroes/moveZeroes.cpp)|Easy| |282|[Expression Add Operators](https://leetcode.com/problems/expression-add-operators/) | [C++](./algorithms/cpp/expressionAddOperators/ExpressionAddOperators.cpp)|Hard| |279|[Perfect Squares](https://leetcode.com/problems/perfect-squares/) | [C++](./algorithms/cpp/perfectSquares/PerfectSquares.cpp)|Medium| |278|[First Bad Version](https://leetcode.com/problems/first-bad-version/)| [C++](./algorithms/cpp/firstBadVersion/FirstBadVersion.cpp), [Java](./algorithms/java/src/firstBadVersion/firstBadVersion.java)|Easy| |275|[H-Index II](https://leetcode.com/problems/h-index-ii/)| [C++](./algorithms/cpp/h-Index/h-Index.II.cpp)|Medium| |274|[H-Index](https://leetcode.com/problems/h-index/)| [C++](./algorithms/cpp/h-Index/h-Index.cpp)|Medium| |273|[Integer to English Words](https://leetcode.com/problems/integer-to-english-words/)| [C++](./algorithms/cpp/integerToEnglishWords/IntegerToEnglishWords.cpp)|Medium| |268|[Missing Number](https://leetcode.com/problems/missing-number/)| [C++](./algorithms/cpp/missingNumber/MissingNumber.cpp)|Medium| |264|[Ugly Number II](https://leetcode.com/problems/ugly-number-ii/)| [C++](./algorithms/cpp/uglyNumber/UglyNumber.II.cpp)|Medium| |263|[Ugly Number](https://leetcode.com/problems/ugly-number/)| [C++](./algorithms/cpp/uglyNumber/UglyNumber.cpp)|Easy| |260|[Single Number III](https://leetcode.com/problems/single-number-iii/)| [C++](./algorithms/cpp/singleNumber/singleNumber.III.cpp)|Medium| |258|[Add Digits](https://leetcode.com/problems/add-digits/)| [C++](./algorithms/cpp/addDigits/addDigits.cpp)|Easy| |257|[Binary Tree Paths](https://leetcode.com/problems/binary-tree-paths/)| [C++](./algorithms/cpp/binaryTreePaths/binaryTreePaths.cpp)|Easy| |242|[Valid Anagram](https://leetcode.com/problems/valid-anagram/)| [C++](./algorithms/cpp/anagrams/ValidAnagram.cpp), [Java](./algorithms/java/src/validAnagram/ValidAnagram.java)|Easy| |241|[Different Ways to Add Parentheses](https://leetcode.com/problems/different-ways-to-add-parentheses/)|[C++](./algorithms/cpp/differentWaysToAddParentheses/DifferentWaysToAddParentheses.cpp), [Python](./algorithms/python/DifferentWaysToAddParentheses/diffWaysToCompute.py)|Medium| |240|[Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/)|[C++](./algorithms/cpp/search2DMatrix/search2DMatrix.II.cpp), [Java](./algorithms/java/src/searchA2DMatrixII/SearchA2DMatrixII.java), [Python](./algorithms/python/SearchA2DMatrixII/searchMatrix.py)|Medium| |239|[Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/)| [C++](./algorithms/cpp/slidingWindowMaximum/SlidingWindowMaximum.cpp)|Hard| |238|[Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/)| [C++](./algorithms/cpp/productOfArrayExceptSelf/ProductOfArrayExceptSelf.cpp)|Medium| |237|[Delete Node in a Linked List](https://leetcode.com/problems/delete-node-in-a-linked-list/)| [C++](./algorithms/cpp/deleteNodeInALinkedList/DeleteNodeInALinkedList.cpp)|Easy| |236|[Lowest Common Ancestor of a Binary Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/)| [C++](./algorithms/cpp/lowestCommonAncestorOfABinaryTree/LowestCommonAncestorOfABinaryTree.cpp), [Java](./algorithms/java/src/lowestCommonAncestorOfABinaryTree/lowestCommonAncestorOfABinaryTree.java), [Python](./algorithms/python/LowestCommonAncestorOfABinaryTree/lowestCommonAncestor.py)|Medium| |235|[Lowest Common Ancestor of a Binary Search Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/)| [C++](./algorithms/cpp/lowestCommonAncestorOfABinarySearchTree/LowestCommonAncestorOfABinarySearchTree.cpp), [Python](./algorithms/python/LowestCommonAncestorOfABinarySearchTree/lowestCommonAncestor.py)|Easy| |234|[Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/)| [C++](./algorithms/cpp/palindromeLinkedList/PalindromeLinkedList.cpp)|Easy| |233|[Number of Digit One](https://leetcode.com/problems/number-of-digit-one/)| [C++](./algorithms/cpp/numberOfDigitOne/NumberOfDigitOne.cpp)|Medium| |232|[Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks/)| [C++](./algorithms/cpp/implementQueueUsingStacks/ImplementQueueUsingStacks.cpp), [Java](./algorithms/java/src/myQueue/MyQueue.java)|Easy| |231|[Power of Two](https://leetcode.com/problems/power-of-two/)| [C++](./algorithms/cpp/powerOfTwo/PowerOfTwo.cpp)|Easy| |230|[Kth Smallest Element in a BST](https://leetcode.com/problems/kth-smallest-element-in-a-bst/)| [C++](./algorithms/cpp/kthSmallestElementInaBST/KthSmallestElementInABst.cpp), [Python](./algorithms/python/KthSmallestElementInABST/kthSmallest.py)|Medium| |229|[Majority Element II](https://leetcode.com/problems/majority-element-ii/) | [C++](./algorithms/cpp/majorityElement/majorityElement.II.cpp)|Medium| |228|[Summary Ranges](https://leetcode.com/problems/summary-ranges/)| [C++](./algorithms/cpp/summaryRanges/SummaryRanges.cpp)|Easy| |227|[Basic Calculator II](https://leetcode.com/problems/basic-calculator-ii/)| [C++](./algorithms/cpp/basicCalculator/BasicCalculator.II.cpp)|Medium| |226|[Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/)| [C++](./algorithms/cpp/invertBinaryTree/InvertBinaryTree.cpp)|Easy| |225|[Implement Stack using Queues](https://leetcode.com/problems/implement-stack-using-queues/)| [C++](./algorithms/cpp/implementStackUsingQueues/ImplementStackUsingQueues.cpp), [Java](./algorithms/java/src/myStack/MyStack.java)|Medium| |224|[Basic Calculator](https://leetcode.com/problems/basic-calculator/)| [C++](./algorithms/cpp/basicCalculator/BasicCalculator.cpp)|Medium| |223|[Rectangle Area](https://leetcode.com/problems/rectangle-area/)| [C++](./algorithms/cpp/rectangleArea/RectangleArea.cpp)|Easy| |222|[Count Complete Tree Nodes](https://leetcode.com/problems/count-complete-tree-nodes/)| [C++](./algorithms/cpp/countCompleteTreeNodes/CountCompleteTreeNodes.cpp), [Python](./algorithms/python/CountCompleteTreeNodes/countNodes.py)|Medium| |221|[Maximal Square](https://leetcode.com/problems/maximal-square/)| [C++](./algorithms/cpp/maximalSquare/MaximalSquare.cpp)|Medium| |220|[Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/)| [C++](./algorithms/cpp/containsDuplicate/ContainsDuplicate.III.cpp), [Python](./algorithms/python/ContainsDuplicateIII/containsNearbyAlmostDuplicate.py)|Medium| |219|[Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/)| [C++](./algorithms/cpp/containsDuplicate/ContainsDuplicate.II.cpp), [Python](./algorithms/python/ContainsDuplicateII/containsNearbyDuplicate.py)|Easy| |218|[The Skyline Problem](https://leetcode.com/problems/the-skyline-problem/)| [C++](./algorithms/cpp/theSkylineProblem/TheSkylineProblem.cpp)|Hard| |217|[Contains Duplicate](https://leetcode.com/problems/contains-duplicate/)| [C++](./algorithms/cpp/containsDuplicate/ContainsDuplicate.cpp)|Easy| |216|[Combination Sum III](https://leetcode.com/problems/combination-sum-iii/)| [C++](./algorithms/cpp/combinationSum/combinationSum.III.cpp)|Medium| |215|[Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/)| [C++](./algorithms/cpp/kthLargestElementInAnArray/KthLargestElementInAnArray.cpp)|Medium| |214|[Shortest Palindrome](https://leetcode.com/problems/shortest-palindrome/)| [C++](./algorithms/cpp/shortestPalindrome/ShortestPalindrome.cpp)|Hard| |213|[House Robber II](https://leetcode.com/problems/house-robber-ii/)| [C++](./algorithms/cpp/houseRobber/houseRobber.II.cpp)|Medium| |212|[Word Search II](https://leetcode.com/problems/word-search-ii/)| [C++](./algorithms/cpp/wordSearch/wordSearch.II.cpp)|Hard| |211|[Add and Search Word - Data structure design](https://leetcode.com/problems/add-and-search-word-data-structure-design/)| [C++](./algorithms/cpp/addAndSearchWord/AddAndSearchWord.cpp)|Medium| |210|[Course Schedule II](https://leetcode.com/problems/course-schedule-ii/)| [C++](./algorithms/cpp/courseSchedule/CourseSchedule.II.cpp)|Medium| |209|[Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/)| [C++](./algorithms/cpp/minimumSizeSubarraySum/MinimumSizeSubarraySum.cpp)|Medium| |208|[Implement Trie (Prefix Tree)](https://leetcode.com/problems/implement-trie-prefix-tree/)| [C++](./algorithms/cpp/implementTriePrefixTree/ImplementTriePrefixTree.cpp)|Medium| |207|[Course Schedule](https://leetcode.com/problems/course-schedule/)| [C++](./algorithms/cpp/courseSchedule/CourseSchedule.cpp)|Medium| |206|[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/)| [C++](./algorithms/cpp/reverseLinkedList/reverseLinkedList.cpp), [Java](./algorithms/java/src/reverseLinkedList/ReverseLinkedList.java)|Easy| |205|[Isomorphic Strings](https://leetcode.com/problems/isomorphic-strings/)| [C++](./algorithms/cpp/isomorphicStrings/IsomorphicStrings.cpp)|Easy| |204|[Count Primes](https://leetcode.com/problems/count-primes/)| [C++](./algorithms/cpp/countPrimes/CountPrimes.cpp)|Easy| |203|[Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/)| [C++](./algorithms/cpp/removeLinkedListElements/RemoveLinkedListElements.cpp)|Easy| |202|[Happy Number](https://leetcode.com/problems/happy-number/)| [C++](./algorithms/cpp/happyNumber/HappyNumber.cpp), [Python](./algorithms/python/HappyNumber/isHappy.py)|Easy| |201|[Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range/)| [C++](./algorithms/cpp/bitwiseANDOfNumbersRange/BitwiseAndOfNumbersRange.cpp)|Medium| |200|[Number of Islands](https://leetcode.com/problems/number-of-islands/)| [C++](./algorithms/cpp/numberOfIslands/NumberOfIslands.cpp), [Python](./algorithms/python/NumberOfIslands/numIslands.py)|Medium| |199|[Binary Tree Right Side View](https://leetcode.com/problems/binary-tree-right-side-view/)| [C++](./algorithms/cpp/binaryTreeRightSideView/binaryTreeRightSideView.cpp)|Medium| |198|[House Robber](https://leetcode.com/problems/house-robber/)| [C++](./algorithms/cpp/houseRobber/houseRobber.cpp), [Python](./algorithms/python/HouseRobber/rob.py)|Easy| |191|[Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/)| [C++](./algorithms/cpp/numberOf1Bits/numberOf1Bits.cpp)|Easy| |190|[Reverse Bits](https://leetcode.com/problems/reverse-bits/)| [C++](./algorithms/cpp/reverseBits/reverseBits.cpp)|Easy| |189|[Rotate Array](https://leetcode.com/problems/rotate-array/)| [C++](./algorithms/cpp/rotateArray/rotateArray.cpp), [Java](./algorithms/java/src/rotateArray/RotateArray.java)|Easy| |188|[Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/)| [C++](./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp)|Hard| |187|[Repeated DNA Sequences](https://leetcode.com/problems/repeated-dna-sequences/)| [C++](./algorithms/cpp/repeatedDNASequences/repeatedDNASequences.cpp)|Medium| |186|[Reverse Words in a String II](https://leetcode.com/problems/reverse-words-in-a-string-ii/) 🔒 | [C++](./algorithms/cpp/reverseWordsInAString/reverseWordsInAString.II.cpp)|Medium| |179|[Largest Number](https://leetcode.com/problems/largest-number/) | [C++](./algorithms/cpp/largestNumber/largestNumber.cpp)|Medium| |174|[Dungeon Game](https://leetcode.com/problems/dungeon-game/) | [C++](./algorithms/cpp/dungeonGame/dungeonGame.cpp)|Hard| |173|[Binary Search Tree Iterator](https://leetcode.com/problems/binary-search-tree-iterator/) | [C++](./algorithms/cpp/binarySearchTreeIterator/binarySearchTreeIterator.cpp), [Java](./algorithms/java/src/binarySearchTreeIterator/binarySearchTreeIterator.java), [Python](./algorithms/python/BinarySearchTreeIterator/BSTIterator.py)|Medium| |172|[Factorial Trailing Zeroes](https://leetcode.com/problems/factorial-trailing-zeroes/) | [C++](./algorithms/cpp/factorialTrailingZeroes/factorialTrailingZeroes.cpp)|Easy| |171|[Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/) | [C++](./algorithms/cpp/excelSheetColumnNumber/excelSheetColumnNumber.cpp)|Easy| |170|[Two Sum III - Data structure design](https://leetcode.com/problems/two-sum-iii-data-structure-design/) 🔒 | [C++](./algorithms/cpp/twoSum/twoSum.III.cpp)|Easy| |169|[Majority Element](https://leetcode.com/problems/majority-element/) | [C++](./algorithms/cpp/majorityElement/majorityElement.cpp)|Easy| |168|[Excel Sheet Column Title](https://leetcode.com/problems/excel-sheet-column-title/) | [C++](./algorithms/cpp/excelSheetColumnTitle/excelSheetColumnTitle.cpp)|Easy| |167|[Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/) 🔒 | [C++](./algorithms/cpp/twoSum/twoSum.II.cpp)|Medium| |166|[Fraction to Recurring Decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/) | [C++](./algorithms/cpp/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp)|Medium| |165|[Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [C++](./algorithms/cpp/compareVersionNumbers/compareVersionNumbers.cpp)|Easy| |164|[Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [C++](./algorithms/cpp/maximumGap/maximumGap.cpp)|Hard| |163|[Missing Ranges](https://leetcode.com/problems/missing-ranges/) 🔒 | [C++](./algorithms/cpp/missingRanges/missingRanges.cpp)|Medium| |162|[Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [C++](./algorithms/cpp/findPeakElement/findPeakElement.cpp), [Java](./algorithms/java/src/findPeakElement/findPeakElement.java)|Medium| |161|[One Edit Distance](https://leetcode.com/problems/one-edit-distance/)🔒 | [C++](./algorithms/cpp/oneEditDistance/oneEditDistance.cpp)|Medium| |160|[Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/) | [C++](./algorithms/cpp/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp)|Easy| |159|[Longest Substring with At Most Two Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/) 🔒 | [C++](./algorithms/cpp/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp)|Hard| |158|[Read N Characters Given Read4 II - Call multiple times](https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times/) 🔒 | [C++](./algorithms/cpp/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp)|Hard| |157|[Read N Characters Given Read4](https://leetcode.com/problems/read-n-characters-given-read4/) 🔒 | [C++](./algorithms/cpp/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp)|Easy| |156|[Binary Tree Upside Down](https://leetcode.com/problems/binary-tree-upside-down/) 🔒 | [C++](./algorithms/cpp/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp)|Medium| |155|[Min Stack](https://leetcode.com/problems/min-stack/)| [C++](./algorithms/cpp/minStack/minStack.cpp), [Java](./algorithms/java/src/minStack/MinStack.java)|Easy| |154|[Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)| [C++](./algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp)|Hard| |153|[Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/)| [C++](./algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp), [Java](./algorithms/java/src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.java)|Medium| |152|[Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/)| [C++](./algorithms/cpp/maximumProductSubarray/maximumProductSubarray.cpp)|Medium| |151|[Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/)| [C++](./algorithms/cpp/reverseWordsInAString/reverseWordsInAString.cpp), [Java](./algorithms/java/src/reverseWordsInAString/ReverseWordsInAString.java)|Medium| |150|[Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/)| [C++](./algorithms/cpp/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp)|Medium| |149|[Max Points on a Line](https://leetcode.com/problems/max-points-on-a-line/)| [C++](./algorithms/cpp/maxPointsOnALine/maxPointsOnALine.cpp)|Hard| |148|[Sort List](https://leetcode.com/problems/sort-list/)| [C++](./algorithms/cpp/sortList/sortList.cpp), [Python](./algorithms/python/SortList/sortList.py)|Medium| |147|[Insertion Sort List](https://leetcode.com/problems/insertion-sort-list/)| [C++](./algorithms/cpp/insertionSortList/insertionSortList.cpp), [Python](./algorithms/python/InsertionSortList/insertionSortList.py)|Medium| |146|[LRU Cache](https://leetcode.com/problems/lru-cache/)| [C++](./algorithms/cpp/LRUCache/LRUCache.cpp), [Java](./algorithms/java/src/lruCache/LRUCache.java)|Hard| |145|[Binary Tree Postorder Traversal](https://leetcode.com/problems/binary-tree-postorder-traversal/)| [C++](./algorithms/cpp/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp), [Python](./algorithms/python/BinaryTreePostorderTraversal/postorderTraversal.py)|Hard| |144|[Binary Tree Preorder Traversal](https://leetcode.com/problems/binary-tree-preorder-traversal/)| [C++](./algorithms/cpp/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp), [Java](./algorithms/java/src/binaryTreePreorderTraversal/binaryTreePreorderTraversal.java)|Medium| |143|[Reorder List](https://leetcode.com/problems/reorder-list/)| [C++](./algorithms/cpp/reorderList/reorderList.cpp), [Python](./algorithms/python/ReorderList/reorderList.py)|Medium| |142|[Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/)| [C++](./algorithms/cpp/linkedListCycle/linkedListCycle.II.cpp), [Python](./algorithms/python/LinkedListCycleII/detectCycle.py)|Medium| |141|[Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/)| [C++](./algorithms/cpp/linkedListCycle/linkedListCycle.cpp)|Medium| |140|[Word Break II](https://leetcode.com/problems/word-break-ii/)| [C++](./algorithms/cpp/wordBreak/wordBreak.II.cpp)|Hard| |139|[Word Break](https://leetcode.com/problems/word-break/)| [C++](./algorithms/cpp/wordBreak/wordBreak.cpp)|Medium| |138|[Copy List with Random Pointer](https://leetcode.com/problems/copy-list-with-random-pointer/)| [C++](./algorithms/cpp/copyListWithRandomPointer/copyListWithRandomPointer.cpp), [Python](./algorithms/python/CopyListWithRandomPointer/copyRandomList.py)|Hard| |137|[Single Number II](https://leetcode.com/problems/single-number-ii/)| [C++](./algorithms/cpp/singleNumber/singleNumber.II.cpp), [Python](./algorithms/python/SingleNumberII/SingleNumberII.py)|Medium| |136|[Single Number](https://leetcode.com/problems/single-number/)| [C++](./algorithms/cpp/singleNumber/singleNumber.cpp)|Medium| |135|[Candy](https://leetcode.com/problems/candy/)| [C++](./algorithms/cpp/candy/candy.cpp)|Hard| |134|[Gas Station](https://leetcode.com/problems/gas-station/)| [C++](./algorithms/cpp/gasStation/gasStation.cpp)|Medium| |133|[Clone Graph](https://leetcode.com/problems/clone-graph/)| [C++](./algorithms/cpp/cloneGraph/cloneGraph.cpp)|Medium| |132|[Palindrome Partitioning II](https://leetcode.com/problems/palindrome-partitioning-ii/)| [C++](./algorithms/cpp/palindromePartitioning/palindromePartitioning.II.cpp)|Hard| |131|[Palindrome Partitioning](https://leetcode.com/problems/palindrome-partitioning/)| [C++](./algorithms/cpp/palindromePartitioning/palindromePartitioning.cpp)|Medium| |130|[Surrounded Regions](https://leetcode.com/problems/surrounded-regions/)| [C++](./algorithms/cpp/surroundedRegions/surroundedRegions.cpp)|Medium| |129|[Sum Root to Leaf Numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/)| [C++](./algorithms/cpp/sumRootToLeafNumber/sumRootToLeafNumber.cpp), [Python](./algorithms/python/SumRootToLeafNumbers/sumNumbers.py)|Medium| |128|[Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/)| [C++](./algorithms/cpp/longestConsecutiveSequence/longestConsecutiveSequence.cpp), [Python](./algorithms/python/LongestConsecutiveSequence/LongestConsecutive.py)|Medium| |127|[Word Ladder](https://leetcode.com/problems/word-ladder/)| [C++](./algorithms/cpp/wordLadder/wordLadder.cpp)|Medium| |126|[Word Ladder II](https://leetcode.com/problems/word-ladder-ii/)| [C++](./algorithms/cpp/wordLadder/wordLadder.II.cpp)|Hard| |125|[Valid Palindrome](https://leetcode.com/problems/valid-palindrome/)| [C++](./algorithms/cpp/validPalindrome/validPalindrome.cpp), [Java](./algorithms/java/src/validPalindrome/ValidPalindrome.java)|Easy| |124|[Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/)| [C++](./algorithms/cpp/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp), [Java](./algorithms/java/src/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.java)|Hard| |123|[Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/)| [C++](./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp)|Hard| |122|[Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/)| [C++](./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp)|Medium| |121|[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)| [C++](./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp)|Medium| |120|[Triangle](https://leetcode.com/problems/triangle/)| [C++](./algorithms/cpp/triangle/triangle.cpp), [Java](./algorithms/java/src/dynamicProgramming/triangle/triangle.java)|Medium| |119|[Pascal's Triangle II](https://leetcode.com/problems/pascals-triangle-ii/)| [C++](./algorithms/cpp/pascalTriangle/pascalTriangle.II.cpp)|Easy| |118|[Pascal's Triangle](https://leetcode.com/problems/pascals-triangle/)| [C++](./algorithms/cpp/pascalTriangle/pascalTriangle.cpp)|Easy| |117|[Populating Next Right Pointers in Each Node II](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/)| [C++](./algorithms/cpp/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp), [Python](./algorithms/python/PopulatingNextRightPointersInEachNodeII/connect.py)|Hard| |116|[Populating Next Right Pointers in Each Node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/)| [C++](./algorithms/cpp/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp), [Python](./algorithms/python/PopulatingNextRightPointersInEachNode/connect.py)|Medium| |115|[Distinct Subsequences](https://leetcode.com/problems/distinct-subsequences/)| [C++](./algorithms/cpp/distinctSubsequences/distinctSubsequences.cpp)|Hard| |114|[Flatten Binary Tree to Linked List](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/)| [C++](./algorithms/cpp/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp), [Python](./algorithms/python/FlattenBinaryTreeToLinkedList/flatten.py)|Medium| |113|[Path Sum II](https://leetcode.com/problems/path-sum-ii/)| [C++](./algorithms/cpp/pathSum/pathSum.II.cpp), [Python](./algorithms/python/PathSumII/pathSum.py)|Medium| |112|[Path Sum](https://leetcode.com/problems/path-sum/)| [C++](./algorithms/cpp/pathSum/pathSum.cpp)|Easy| |111|[Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/)| [C++](./algorithms/cpp/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp)|Easy| |110|[Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree/)| [C++](./algorithms/cpp/balancedBinaryTree/balancedBinaryTree.cpp), [Java](./algorithms/java/src/balancedBinaryTree/balancedBinaryTree.java)|Easy| |109|[Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/)| [C++](./algorithms/cpp/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp)|Medium| |108|[Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/)| [C++](./algorithms/cpp/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp)|Medium| |107|[Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/)| [C++](./algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp)|Easy| |106|[Construct Binary Tree from Inorder and Postorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/)| [C++](./algorithms/cpp/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp), [Python](./algorithms/python/ConstructBinaryTreeFromInorderAndPostorderTraversal/buildTree.py)|Medium| |105|[Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)| [C++](./algorithms/cpp/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp), [Python](./algorithms/python/ConstructBinaryTreeFromPreorderAndInorderTraversal/buildTree.py)|Medium| |104|[Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/)| [C++](./algorithms/cpp/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp), [Java](./algorithms/java/src/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.java)|Easy| |103|[Binary Tree Zigzag Level Order Traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/)| [C++](./algorithms/cpp/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp), [Python](./algorithms/python/BinaryTreeZigzagLevelOrderTraversal/zigzagLevelOrder.py)|Medium| |102|[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)| [C++](./algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp), [Java](./algorithms/java/src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.java)|Easy| |101|[Symmetric Tree](https://leetcode.com/problems/symmetric-tree/)| [C++](./algorithms/cpp/symmetricTree/symmetricTree.cpp)|Easy| |100|[Same Tree](https://leetcode.com/problems/same-tree/)| [C++](./algorithms/cpp/sameTree/sameTree.cpp)|Easy| |99|[Recover Binary Search Tree](https://leetcode.com/problems/recover-binary-search-tree/)| [C++](./algorithms/cpp/recoverBinarySearchTree/recoverBinarySearchTree.cpp)|Hard| |98|[Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/)| [C++](./algorithms/cpp/validateBinarySearchTree/validateBinarySearchTree.cpp), [Java](./algorithms/java/src/validateBinarySearchTree/validateBinarySearchTree.java), [Python](./algorithms/python/ValidateBinarySearchTree/isValidBST.py)|Medium| |97|[Interleaving String](https://leetcode.com/problems/interleaving-string/)| [C++](./algorithms/cpp/interleavingString/interleavingString.cpp)|Hard| |96|[Unique Binary Search Trees](https://leetcode.com/problems/unique-binary-search-trees/)| [C++](./algorithms/cpp/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp), [Python](./algorithms/python/UniqueBinarySearchTrees/numTrees.py)|Medium| |95|[Unique Binary Search Trees II](https://leetcode.com/problems/unique-binary-search-trees-ii/)| [C++](./algorithms/cpp/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp), [Python](./algorithms/python/UniqueBinarySearchTreesII/generateTrees.py)|Medium| |94|[Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/)| [C++](./algorithms/cpp/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp)|Medium| |93|[Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/)| [C++](./algorithms/cpp/restoreIPAddresses/restoreIPAddresses.cpp)|Medium| |92|[Reverse Linked List II](https://leetcode.com/problems/reverse-linked-list-ii/)| [C++](./algorithms/cpp/reverseLinkedList/reverseLinkedList.II.cpp), [Java](./algorithms/java/src/reverseLinkedListII/ReverseLinkedListII.java), [Python](./algorithms/python/ReverseLinkedListII/reverseBetween.py)|Medium| |91|[Decode Ways](https://leetcode.com/problems/decode-ways/)| [C++](./algorithms/cpp/decodeWays/decodeWays.cpp)|Medium| |90|[Subsets II](https://leetcode.com/problems/subsets-ii/)| [C++](./algorithms/cpp/subsets/subsets.II.cpp), [Java](./algorithms/java/src/subsets/subsetsII.java)|Medium| |89|[Gray Code](https://leetcode.com/problems/gray-code/)| [C++](./algorithms/cpp/grayCode/grayCode.cpp)|Medium| |88|[Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/)| [C++](./algorithms/cpp/mergeTwoSortedArray/mergeTwoSortedArray.cpp)|Easy| |87|[Scramble String](https://leetcode.com/problems/scramble-string/)| [C++](./algorithms/cpp/scrambleString/scrambleString.cpp)|Hard| |86|[Partition List](https://leetcode.com/problems/partition-list/)| [C++](./algorithms/cpp/partitionList/partitionList.cpp), [Python](./algorithms/python/PartitionList/partition.py)|Medium| |85|[Maximal Rectangle](https://leetcode.com/problems/maximal-rectangle/)| [C++](./algorithms/cpp/maximalRectangle/maximalRectangle.cpp)|Hard| |84|[Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/)| [C++](./algorithms/cpp/largestRectangleInHistogram/largestRectangleInHistogram.cpp)|Hard| |83|[Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/)| [C++](./algorithms/cpp/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp)|Easy| |82|[Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/)| [C++](./algorithms/cpp/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp), [Python](./algorithms/python/RemoveDuplicatesFromSortedListII/deleteDuplicates.py)|Medium| |81|[Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/)| [C++](./algorithms/cpp/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp)|Medium| |80|[Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)| [C++](./algorithms/cpp/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp)|Medium| |79|[Word Search](https://leetcode.com/problems/word-search/)| [C++](./algorithms/cpp/wordSearch/wordSearch.cpp)|Medium| |78|[Subsets](https://leetcode.com/problems/subsets/)| [C++](./algorithms/cpp/subsets/subsets.cpp), [Java](./algorithms/java/src/subsets/subsets.java), [Python](./algorithms/python/Subsets/subsets.py)|Medium| |77|[Combinations](https://leetcode.com/problems/combinations/)| [C++](./algorithms/cpp/combinations/combinations.cpp)|Medium| |76|[Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/)| [C++](./algorithms/cpp/minimumWindowSubstring/minimumWindowSubstring.cpp)|Hard| |75|[Sort Colors](https://leetcode.com/problems/sort-colors/)| [C++](./algorithms/cpp/sortColors/sortColors.cpp)|Medium| |74|[Search a 2D Matrix](https://leetcode.com/problems/search-a-2d-matrix/)| [C++](./algorithms/cpp/search2DMatrix/search2DMatrix.cpp), [Java](./algorithms/java/src/search2DMatrix/search2DMatrix.java)|Medium| |73|[Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/)| [C++](./algorithms/cpp/setMatrixZeroes/setMatrixZeroes.cpp)|Medium| |72|[Edit Distance](https://leetcode.com/problems/edit-distance/)| [C++](./algorithms/cpp/editDistance/editDistance.cpp)|Hard| |71|[Simplify Path](https://leetcode.com/problems/simplify-path/)| [C++](./algorithms/cpp/simplifyPath/simplifyPath.cpp)|Medium| |70|[Climbing Stairs](https://leetcode.com/problems/climbing-stairs/)| [C++](./algorithms/cpp/climbStairs/climbStairs.cpp), [Java](./algorithms/java/src/dynamicProgramming/climbStairs/climbStairs.java)|Easy| |69|[Sqrt(x)](https://leetcode.com/problems/sqrtx/)| [C++](./algorithms/cpp/sqrt/sqrt.cpp)|Medium| |68|[Text Justification](https://leetcode.com/problems/text-justification/)| [C++](./algorithms/cpp/textJustification/textJustification.cpp)|Hard| |67|[Add Binary](https://leetcode.com/problems/add-binary/)| [C++](./algorithms/cpp/addBinary/addBinary.cpp)|Easy| |66|[Plus One](https://leetcode.com/problems/plus-one/)| [C++](./algorithms/cpp/plusOne/plusOne.cpp)|Easy| |65|[Valid Number](https://leetcode.com/problems/valid-number/)| [C++](./algorithms/cpp/validNumber/validNumber.cpp)|Easy| |64|[Minimum Path Sum](https://leetcode.com/problems/minimum-path-sum/)| [C++](./algorithms/cpp/minimumPathSum/minimumPathSum.cpp), [Java](./algorithms/java/src/dynamicProgramming/minimumPathSum/minimumPathSum.java)|Medium| |63|[Unique Paths II](https://leetcode.com/problems/unique-paths-ii/)| [C++](./algorithms/cpp/uniquePaths/uniquePaths.II.cpp), [Java](./algorithms/java/src/dynamicProgramming/uniquePaths/uniquePathsII.java)|Medium| |62|[Unique Paths](https://leetcode.com/problems/unique-paths/)| [C++](./algorithms/cpp/uniquePaths/uniquePaths.cpp), [Java](./algorithms/java/src/dynamicProgramming/uniquePaths/uniquePaths.java)|Medium| |61|[Rotate List](https://leetcode.com/problems/rotate-list/)| [C++](./algorithms/cpp/rotateList/rotateList.cpp)|Medium| |60|[Permutation Sequence](https://leetcode.com/problems/permutation-sequence/)| [C++](./algorithms/cpp/permutationSequence/permutationSequence.cpp)|Medium| |59|[Spiral Matrix II](https://leetcode.com/problems/spiral-matrix-ii/)| [C++](./algorithms/cpp/spiralMatrix/spiralMatrix.II.cpp)|Medium| |58|[Length of Last Word](https://leetcode.com/problems/length-of-last-word/)| [C++](./algorithms/cpp/lengthOfLastWord/lengthOfLastWord.cpp), [Java](./algorithms/java/src/lengthOfLastWord/LengthOfLastWord.java)|Easy| |57|[Insert Interval](https://leetcode.com/problems/insert-interval/)| [C++](./algorithms/cpp/insertInterval/insertInterval.cpp)|Hard| |56|[Merge Intervals](https://leetcode.com/problems/merge-intervals/)| [C++](./algorithms/cpp/mergeIntervals/mergeIntervals.cpp)|Hard| |55|[Jump Game](https://leetcode.com/problems/jump-game/)| [C++](./algorithms/cpp/jumpGame/jumpGame.cpp), [Python](./algorithms/python/jumpGame/jumpGame.py)|Medium| |54|[Spiral Matrix](https://leetcode.com/problems/spiral-matrix/)| [C++](./algorithms/cpp/spiralMatrix/spiralMatrix.cpp)|Medium| |53|[Maximum Subarray](https://leetcode.com/problems/maximum-subarray/)| [C++](./algorithms/cpp/maximumSubArray/maximumSubArray.cpp), [Java](./algorithms/java/src/MaxSubArray/MaxSubarray.java)|Medium| |52|[N-Queens II](https://leetcode.com/problems/n-queens-ii/)| [C++](./algorithms/cpp/nQueens/nQueuens.II.cpp)|Hard| |51|[N-Queens](https://leetcode.com/problems/n-queens/)| [C++](./algorithms/cpp/nQueens/nQueuens.cpp)|Hard| |50|["Pow(x, n)"](https://leetcode.com/problems/powx-n/)| [C++](./algorithms/cpp/pow/pow.cpp), [Java](./algorithms/java/src/powXn/PowXn.java)|Medium| |49|[Group Anagrams](https://leetcode.com/problems/anagrams/)| [C++](./algorithms/cpp/anagrams/GroupAnagrams.cpp)|Medium| |48|[Rotate Image](https://leetcode.com/problems/rotate-image/)| [C++](./algorithms/cpp/rotateImage/rotateImage.cpp), [Java](./algorithms/java/src/RotateImage/rotateImage.java)|Medium| |47|[Permutations II](https://leetcode.com/problems/permutations-ii/)| [C++](./algorithms/cpp/permutations/permutations.II.cpp)|Hard| |46|[Permutations](https://leetcode.com/problems/permutations/)| [C++](./algorithms/cpp/permutations/permutations.cpp)|Medium| |45|[Jump Game II](https://leetcode.com/problems/jump-game-ii/)| [C++](./algorithms/cpp/jumpGame/jumpGame.II.cpp)|Hard| |44|[Wildcard Matching](https://leetcode.com/problems/wildcard-matching/)| [C++](./algorithms/cpp/wildcardMatching/wildcardMatching.cpp)|Hard| |43|[Multiply Strings](https://leetcode.com/problems/multiply-strings/)| [C++](./algorithms/cpp/multiplyStrings/multiplyStrings.cpp)|Medium| |42|[Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/)| [C++](./algorithms/cpp/trappingRainWater/trappingRainWater.cpp)|Hard| |41|[First Missing Positive](https://leetcode.com/problems/first-missing-positive/)| [C++](./algorithms/cpp/firstMissingPositive/firstMissingPositive.cpp), [Python](././algorithms/python/firstMissingPositive/firstMissingPositive.py)|Hard| |40|[Combination Sum II](https://leetcode.com/problems/combination-sum-ii/)| [C++](./algorithms/cpp/combinationSum/combinationSum.II.cpp)|Medium| |39|[Combination Sum](https://leetcode.com/problems/combination-sum/)| [C++](./algorithms/cpp/combinationSum/combinationSum.cpp)|Medium| |38|[Count and Say](https://leetcode.com/problems/count-and-say/)| [C++](./algorithms/cpp/countAndSay/countAndSay.cpp), [Java](./algorithms/java/src/countAndSay/CountAndSay.java)|Easy| |37|[Sudoku Solver](https://leetcode.com/problems/sudoku-solver/)| [C++](./algorithms/cpp/sudokuSolver/sudokuSolver.cpp)|Hard| |36|[Valid Sudoku](https://leetcode.com/problems/valid-sudoku/)| [C++](./algorithms/cpp/validSudoku/validSudoku.cpp)|Easy| |35|[Search Insert Position](https://leetcode.com/problems/search-insert-position/)| [C++](./algorithms/cpp/searchInsertPosition/searchInsertPosition.cpp), [Java](./algorithms/java/src/searchInsertPosition/searchInsertPosition.java)|Medium| |34|[Search for a Range](https://leetcode.com/problems/search-for-a-range/)| [C++](./algorithms/cpp/searchForRange/searchForRange.cpp), [Java](./algorithms/java/src/searchForRange/searchForRange.java)|Medium| |33|[Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/)| [C++](./algorithms/cpp/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp), [Java](./algorithms/java/src/searchInRotatedSortedArray/searchInRotatedSortedArray.java)|Hard| |32|[Longest Valid Parentheses](https://leetcode.com/problems/longest-valid-parentheses/)| [C++](./algorithms/cpp/longestValidParentheses/longestValidParentheses.cpp)|Hard| |31|[Next Permutation](https://leetcode.com/problems/next-permutation/)| [C++](./algorithms/cpp/nextPermutation/nextPermutation.cpp)|Medium| |30|[Substring with Concatenation of All Words](https://leetcode.com/problems/substring-with-concatenation-of-all-words/)| [C++](./algorithms/cpp/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp)|Hard| |29|[Divide Two Integers](https://leetcode.com/problems/divide-two-integers/)| [C++](./algorithms/cpp/divideTwoInt/divideTwoInt.cpp)|Medium| |28|[Implement strStr()](https://leetcode.com/problems/implement-strstr/)| [C++](./algorithms/cpp/strStr/strStr.cpp), [Java](./algorithms/java/src/strStr/strStr.java)|Easy| |27|[Remove Element](https://leetcode.com/problems/remove-element/)| [C++](./algorithms/cpp/removeElement/removeElement.cpp)|Easy| |26|[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)| [C++](./algorithms/cpp/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp), [Java](./algorithms/java/src/removeDuplicatesFromSortedArray/RemoveDuplicatesFromSortedArray.java)|Easy| |25|[Reverse Nodes in k-Group](https://leetcode.com/problems/reverse-nodes-in-k-group/)| [C++](./algorithms/cpp/reverseNodesInKGroup/reverseNodesInKGroup.cpp)|Hard| |24|[Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/)| [C++](./algorithms/cpp/swapNodesInPairs/swapNodesInPairs.cpp)|Medium| |23|[Merge k Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/)| [C++](./algorithms/cpp/mergeKSortedLists/mergeKSortedLists.cpp)|Hard| |22|[Generate Parentheses](https://leetcode.com/problems/generate-parentheses/)| [C++](./algorithms/cpp/generateParentheses/generateParentheses.cpp)|Medium| |21|[Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/)| [C++](./algorithms/cpp/mergeTwoSortedList/mergeTwoSortedList.cpp)|Easy| |20|[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/)| [C++](./algorithms/cpp/validParentheses/validParentheses.cpp)|Easy| |19|[Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/)| [C++](./algorithms/cpp/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp), [Python](./algorithms/python/RemoveNthNodeFromEndOfList/removeNthFromEnd.py)|Easy| |18|[4Sum](https://leetcode.com/problems/4sum/)| [C++](./algorithms/cpp/4Sum/4Sum.cpp)|Medium| |17|[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/)| [C++](./algorithms/cpp/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp)|Medium| |16|[3Sum Closest](https://leetcode.com/problems/3sum-closest/)| [C++](./algorithms/cpp/3SumClosest/3SumClosest.cpp)|Medium| |15|[3Sum](https://leetcode.com/problems/3sum/)| [C++](./algorithms/cpp/3Sum/3Sum.cpp)|Medium| |14|[Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/)| [C++](./algorithms/cpp/longestCommonPrefix/longestCommonPrefix.cpp)|Easy| |13|[Roman to Integer](https://leetcode.com/problems/roman-to-integer/)| [C++](./algorithms/cpp/romanToInteger/romanToInteger.cpp)|Easy| |12|[Integer to Roman](https://leetcode.com/problems/integer-to-roman/)| [C++](./algorithms/cpp/integerToRoman/integerToRoman.cpp)|Medium| |11|[Container With Most Water](https://leetcode.com/problems/container-with-most-water/)| [C++](./algorithms/cpp/containerWithMostWater/containerWithMostWater.cpp), [Java](./algorithms/java/src/containerwithmostwater.java)|Medium| |10|[Regular Expression Matching](https://leetcode.com/problems/regular-expression-matching/)| [C++](./algorithms/cpp/regularExpressionMatching/regularExpressionMatching.cpp)|Hard| |9|[Palindrome Number](https://leetcode.com/problems/palindrome-number/)| [C++](./algorithms/cpp/palindromeNumber/palindromeNumber.cpp), [Java](./algorithms/java/src/palindromeNumber/PalindromeNumber.java)|Easy| |8|[String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/)| [C++](./algorithms/cpp/stringToIntegerAtoi/stringToIntegerAtoi.cpp)|Easy| |7|[Reverse Integer](https://leetcode.com/problems/reverse-integer/)| [C++](./algorithms/cpp/reverseInteger/reverseInteger.cpp)|Easy| |6|[ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/)| [C++](./algorithms/cpp/zigZagConversion/zigZagConversion.cpp)|Easy| |5|[Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/)| [C++](./algorithms/cpp/longestPalindromicSubstring/longestPalindromicSubstring.cpp)|Medium| |4|[Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/)| [C++](./algorithms/cpp/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp)|Hard| |3|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/)| [C++](./algorithms/cpp/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp)|Medium| |2|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/)| [C++](./algorithms/cpp/addTwoNumbers/addTwoNumbers.cpp)|Medium| |1|[Two Sum](https://leetcode.com/problems/two-sum/)| [C++](./algorithms/cpp/twoSum/twoSum.cpp), [Go](./algorithms/golang/twoSum/twoSum.go)|Easy| ### LeetCode Shell | # | Title | Solution | Difficulty | |---| ----- | -------- | ---------- | |4|[Tenth Line](https://leetcode.com/problems/tenth-line/)| [Bash](./shell/TenthLine.sh)|Easy| |3|[Transpose File](https://leetcode.com/problems/transpose-file/)| [Bash](./shell/TransposeFile.sh)|Medium| |2|[Valid Phone Numbers](https://leetcode.com/problems/valid-phone-numbers/)| [Bash](./shell/ValidPhoneNumbers.sh)|Easy| |1|[Word Frequency](https://leetcode.com/problems/word-frequency/)| [Bash](./shell/WordFrequency.sh)|Medium| ### LintCode | # | Title | Solution | Difficulty | |---| ----- | -------- | ---------- | |1|[Search in a big sorted array](http://www.lintcode.com/en/problem/search-in-a-big-sorted-array/)|[Java](./algorithms/java/src/searchInABigSortedArray/searchInABigSortedArray.java)|Medium| |2|[Search Range in Binary Search Tree](http://www.lintcode.com/en/problem/search-range-in-binary-search-tree/) | [Java](./algorithms/java/src/searchRangeInBinarySearchTree/searchRangeInBinarySearchTree.java)|Medium| ================================================ FILE: algorithms/cpp/3Sum/3Sum.cpp ================================================ // Source : https://oj.leetcode.com/problems/3sum/ // Author : Hao Chen // Date : 2014-07-22 /********************************************************************************** * * Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? * Find all unique triplets in the array which gives the sum of zero. * * Note: * * Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ≤ b ≤ c) * The solution set must not contain duplicate triplets. * * For example, given array S = {-1 0 1 2 -1 -4}, * * A solution set is: * (-1, 0, 1) * (-1, -1, 2) * * **********************************************************************************/ #include #include #include #include #include using namespace std; /* * Similar like "Two Number" problem, we can have the simlar solution. * * Suppose the input array is S[0..n-1], 3SUM can be solved in O(n^2) time on average by * inserting each number S[i] into a hash table, and then for each index i and j, * checking whether the hash table contains the integer - (s[i]+s[j]) * * Alternatively, the algorithm below first sorts the input array and then tests all * possible pairs in a careful order that avoids the need to binary search for the pairs * in the sorted list, achieving worst-case O(n^n) * * Solution: Quadratic algorithm * http://en.wikipedia.org/wiki/3SUM * */ vector > threeSum(vector &num) { vector< vector > result; if(num.size() == 0 || num.size() == 1 || num.size() == 2) return result; //sort the array, this is the key sort(num.begin(), num.end()); int n = num.size(); for (int i=0; i 0 && num[i - 1] == num[i]) continue; int a = num[i]; int low = i + 1; int high = n - 1; while (low < high) { int b = num[low]; int c = num[high]; if (a + b + c == 0) { //got the soultion vector v; v.push_back(a); v.push_back(b); v.push_back(c); result.push_back(v); // Continue search for all triplet combinations summing to zero. //skip the duplication while(low < n - 1 && num[low] == num[low + 1]) low++; while(high > 0 && num[high] == num[high - 1]) high--; low++; high--; } else if (a+b+c > 0) { //skip the duplication while(high > 0 && num[high] == num[high - 1]) high--; high--; } else { //skip the duplication while(low < n - 1 && num[low] == num[low + 1]) low++; low++; } } } return result; } //using combination method could meet <