Full Code of haoel/leetcode for AI

master 125c4d8d7e3a cached
730 files
1.6 MB
491.6k tokens
2441 symbols
1 requests
Download .txt
Showing preview only (1,880K chars total). Download the full file or copy to clipboard to get everything.
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 <stdio.h>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

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<vector<int> > threeSum(vector<int> &num) {

    vector< vector<int> > 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<n-2; i++) {
        //skip the duplication
        if (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<int> 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 <<Time Limit Exceeded>> error
vector<vector<int> > combination(vector<int> &v, int k);
bool isSumZero(vector<int>& v);
int sum(vector<int>& v);

vector<vector<int> > threeSum2(vector<int> &num) {
    vector< vector<int> > result;
    vector< vector<int> > r = combination(num, 3);
    for (int i = 0; i < r.size(); i++) {
        if (isSumZero(r[i])) {
            result.push_back(r[i]);
        }
    }
    return result;
}

bool isSumZero(vector < int>& v) {
    return sum(v) == 0;
}

int sum(vector<int>& v) {
    int s = 0;
    for(int i = 0; i < v.size(); i++) {
        s += v[i];
    }
    return s;
}

vector<vector<int> > combination(vector<int> &v, int k) {

    vector<vector<int> > result;
    vector<int> d;
    int n = v.size();
    for (int i = 0; i < n; i++) {
        d.push_back( (i < k) ? 1 : 0 );
    }

    //1) from the left, find the [1,0] pattern, change it to [0,1]
    //2) move all of the 1 before the pattern to the most left side
    //3) check all of 1 move to the right
    while(1) {
        vector<int> tmp;
        for(int x = 0; x < n; x++) {
            if (d[x]) tmp.push_back(v[x]);
        }
        sort(tmp.begin(), tmp.end());
        result.push_back(tmp);
        //step 1), find [1,0] pattern
        int i;
        bool found = false;
        int ones = 0;
        for(i = 0; i < n - 1; i++) {

            if (d[i] == 1 && d[i + 1] == 0) {
                d[i] = 0; d[i + 1] = 1;
                found = true;
                //step 2) move all of right 1 to the most left side
                for (int j = 0; j < i; j++) {
                    d[j] = ( ones > 0 ) ? 1 : 0;
                    ones--;
                }
                break;
            }
            if (d[i] == 1) ones++;
        }
        if (!found) {
            break;
        }

    }
    return result;
}


void printMatrix(vector<vector<int> > &matrix)
{
    for(int i = 0; i < matrix.size(); i++) {
        printf("{");
        for(int j = 0; j < matrix[i].size(); j++) {
            printf("%3d ", matrix[i][j]) ;
        }
        printf("}\n");
    }
    cout << endl;
}


int main()
{
    //int a[] = { -1, 0, 1, 2, -1, 1, -4 };
    int a[] = { -1, 1, 1, 1, -1, -1, 0,0,0 };
    vector<int> n(a, a + sizeof(a)/sizeof(int));
    vector< vector<int> > result = threeSum(n);
    printMatrix(result);    
    return 0;
}


================================================
FILE: algorithms/cpp/3SumClosest/3SumClosest.cpp
================================================
// Source : https://oj.leetcode.com/problems/3sum-closest/
// Author : Hao Chen
// Date   : 2014-07-03

/********************************************************************************** 
* 
* Given an array S of n integers, find three integers in S such that the sum is 
* closest to a given number, target. Return the sum of the three integers. 
* You may assume that each input would have exactly one solution.
* 
*     For example, given array S = {-1 2 1 -4}, and target = 1.
* 
*     The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).
* 
*               
**********************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

#define INT_MAX 2147483647
//solution:  http://en.wikipedia.org/wiki/3SUM
//the idea as blow:
//  1) sort the array.
//  2) take the element one by one, calculate the two numbers in reset array.
//
//notes: be careful the duplication number.
//
// for example:
//    [-4,-1,-1,1,2]    target=1
// 
//    take -4, can cacluate the "two number problem" of the reset array [-1,-1,1,2] while target=5
//    [(-4),-1,-1,1,2]  target=5  distance=4
//           ^      ^ 
//    because the -1+2 = 1 which < 5, then move the `low` pointer(skip the duplication)
//    [(-4),-1,-1,1,2]  target=5  distance=2
//                ^ ^ 
//    take -1(skip the duplication), can cacluate the "two number problem" of the reset array [1,2] while target=2
//    [-4,-1,(-1),1,2]  target=2  distance=1
//                ^ ^ 
int threeSumClosest(vector<int> &num, int target) {
    //sort the array
    sort(num.begin(), num.end());

    int n = num.size();
    int distance = INT_MAX;
    int result;

    for (int i=0; i<n-2; i++) {
        //skip the duplication
        if (i > 0 && num[i - 1] == num[i]) continue;
        int a = num[i];
        int low = i + 1;
        int high = n - 1;
        //convert the 3sum to 2sum problem
        while (low < high) {
            int b = num[low];
            int c = num[high];
            int sum = a + b + c;
            if (sum - target == 0) {
                //got the final soultion
                return target;
            } else {
                //tracking the minmal distance
                if (abs(sum - target) < distance ) {
                    distance = abs(sum - target);
                    result = sum;
                }

                if (sum - target > 0) {
                    //skip the duplication
                    while(high > 0 && num[high] == num[high - 1]) high--;
                    //move the `high` pointer
                    high--;
                } else {
                    //skip the duplication
                    while(low < n && num[low] == num[low + 1]) low++;
                    //move the `low` pointer
                    low++;
                }
            }
        }
    }

    return result;
}




int main()
{
    int a[] = { -1, 2, 1, -4 };
    vector<int> n(a, a + sizeof(a)/sizeof(int));
    int target = 1;
    cout << threeSumClosest(n, target) << endl;
    return 0;
}


================================================
FILE: algorithms/cpp/4Sum/4Sum.cpp
================================================
// Source : https://oj.leetcode.com/problems/4sum/
// Author : Hao Chen
// Date   : 2014-07-03

/********************************************************************************** 
* 
* Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? 
* Find all unique quadruplets in the array which gives the sum of target.
* 
* Note:
* 
* Elements in a quadruplet (a,b,c,d) must be in non-descending order. (ie, a ≤ b ≤ c ≤ d)
* The solution set must not contain duplicate quadruplets.
* 
*     For example, given array S = {1 0 -1 0 -2 2}, and target = 0.
* 
*     A solution set is:
*     (-1,  0, 0, 1)
*     (-2, -1, 1, 2)
*     (-2,  0, 0, 2)
* 
*               
**********************************************************************************/

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

vector<vector<int> > threeSum(vector<int> num, int target); 

/*
 * 1) Sort the array,
 * 2) traverse the array, and solve the problem by using "3Sum" soultion.
 */

vector<vector<int> > fourSum(vector<int> &num, int target) {
    vector< vector<int> > result;
    if (num.size() < 4) return result;
    sort( num.begin(), num.end() );

    for(int i = 0; i < num.size() - 3; i++) {
        //skip the duplication
        if (i > 0 && num[i - 1] == num[i]) continue;
        vector<int> n(num.begin()+i+1, num.end());
        vector<vector<int> > ret = threeSum(n, target-num[i]);
        for(int j = 0; j < ret.size(); j++) {
            ret[j].insert(ret[j].begin(), num[i]);
            result.push_back(ret[j]);
        }
    }

    return result; 
}

vector<vector<int> > threeSum(vector<int> num, int target) {

    vector< vector<int> > result;
    //sort the array (if the qrray is sorted already, it won't waste any time)
    sort(num.begin(), num.end());

    int n = num.size();

    for (int i = 0; i < n - 2; i++) {
        //skip the duplication
        if (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 == target) {
                //got the soultion
                vector<int> 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 && num[low] == num[low + 1]) low++;
                while(high > 0 && num[high] == num[high - 1]) high--;
                low++;
                high--;
            } else if (a + b + c > target) {
                //skip the duplication
                while(high > 0 && num[high] == num[high - 1]) high--;
                high--;
            } else {
                //skip the duplication
                while(low < n && num[low] == num[low + 1]) low++;
                low++;
            }
        }
    }
    return result;
}


int printMatrix(vector< vector<int> > &vv)
{
    for(int i = 0; i < vv.size(); i++) {
        cout << "[";
        for(int j = 0; j < vv[i].size(); j++) {
            cout << " " << vv[i][j];
        }
        cout << "]" << endl;;
    }
}


int main()
{
    int a[] = { 1, 0, -1, 0, -2, 2 };
    vector<int> n(a, a+6);
    int t = 0;
    vector< vector<int> > v = fourSum(n, t);
    printMatrix(v);

    n.clear();
    int b[] = { -1, -5, -5, -3, 2, 5, 0, 4 };
    n.insert(n.begin(), b, b+8);
    t = -7;
    v = fourSum(n, t);
    printMatrix(v);

    return 0;
}


================================================
FILE: algorithms/cpp/FindValidMatrixGivenRowAndColumnSums/FindValidMatrixGivenRowAndColumnSums.cpp
================================================
// Source : https://leetcode.com/problems/find-valid-matrix-given-row-and-column-sums/
// Author : Sudesh Chaudhary
// Date   : 2020-10-03
/*******************************************************************************
* You are given two arrays rowSum and colSum of non-negative integers where rowSum[i] is the sum
* of the elements in the ith row and colSum[j] is the sum of the elements of the jth column of a 2D matrix.
* In other words, you do not know the elements of the matrix, but you do know the sums of each row and column.
*
* Find any matrix of non-negative integers of size rowSum.length x colSum.length that satisfies the rowSum and
* colSum requirements.
*
* Return a 2D array representing any matrix that fulfills the requirements. It's guaranteed that at
* least one matrix that fulfills the requirements exists.
* Example 1:
*
* Input: rowSum = [3,8], colSum = [4,7]
* Output: [[3,0],
*          [1,7]]
* Explanation:
* 0th row: 3 + 0 = 0 == rowSum[0]
* 1st row: 1 + 7 = 8 == rowSum[1]
* 0th column: 3 + 1 = 4 == colSum[0]
* 1st column: 0 + 7 = 7 == colSum[1]
* The row and column sums match, and all matrix elements are non-negative.
* Another possible matrix is: [[1,2],
*                             [3,5]]
* Example 2:
*
* Input: rowSum = [5,7,10], colSum = [8,6,8]
* Output: [[0,5,0],
*         [6,1,0],
*         [2,0,8]]
* Example 3:
*
* Input: rowSum = [14,9], colSum = [6,9,8]
* Output: [[0,9,5],
*          [6,0,3]]
* Example 4:
*
* Input: rowSum = [1,0], colSum = [1]
* Output: [[1],
*         [0]]
* Example 5:
*
* Input: rowSum = [0], colSum = [0]
* Output: [[0]]
*********************************************************************************/
class Solution {
public:
    vector<vector<int>> restoreMatrix(vector<int>& row, vector<int>& col) {
        int n = row.size();
        int m = col.size();
        if(n==0 ||m==0)
            return {};
        vector<vector<int>> res(n,vector<int>(m,0));
        priority_queue<pair<int,int>> p,q;
        for(int i=0;i<n;i++){
            p.push({row[i],i});
        }
        for(int j=0;j<m;j++){
            q.push({col[j],j});
        }

        while(!q.empty() && !p.empty()){
            auto a = p.top();
            auto b = q.top();
            p.pop();
            q.pop();
            int t = min(a.first,b.first);
            res[a.second][b.second]=t;
            a.first-=t;
            b.first-=t;
            if(a.first>0)
                p.push(a);
            if(b.first>0)
                q.push(b);
        }
        return res;
    }
};


================================================
FILE: algorithms/cpp/LRUCache/LRUCache.cpp
================================================
// Source : https://oj.leetcode.com/problems/lru-cache/
// Author : Hao Chen
// Date   : 2014-10-12

/********************************************************************************** 
* 
* Design and implement a data structure for Least Recently Used (LRU) cache. 
* It should support the following operations: get and set.
* 
*    get(key) - Get the value (will always be positive) of the key if the key exists 
*               in the cache, otherwise return -1.
*
*    set(key, value) - Set or insert the value if the key is not already present. 
*                      When the cache reached its capacity, it should invalidate 
*                      the least recently used item before inserting a new item.
*               
**********************************************************************************/

#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <map>
using namespace std;

// The idea here is quite simple:
//    1) A Map to index the key.  O(1) key search time-complexity.
//    2) A List to sort the cache data by accessed time.
// 
//  Considering there are too many insert/delete opreations for the List, 
//  The ouble linked list is the good data structure to performance it.

class Node {
    public:
        int key;
        int value;
        Node *next, *prev;
        Node(int k, int v) { key=k; value=v; next = prev = NULL; }
        //Node(int k, int v, Node* n=NULL, Node* p=NULL): key(k), value(v), next(n), prev(p) {}
};

// the following double linked list seems a bit commplicated.
class DoubleLinkedList {

    private:

        Node *pHead, *pTail;
        int size;


    public:

        DoubleLinkedList(){
            pHead = pTail = NULL;
            size = 0;
        }
        ~DoubleLinkedList() {
            while(pHead!=NULL){
                Node*p = pHead;
                pHead = pHead->next;
                delete p;
            }
        }

        int Size() const {
            return size;
        }

        Node* NewAtBegin(int key, int value) {
            Node *n = new Node(key, value);
            return AddAtBegin(n);
        }

        Node* NewAtEnd(int key, int value) {
            Node *n = new Node(key, value);
            return AddAtEnd(n);
        }

        Node* AddAtBegin(Node* n){
            size++;

            if (pHead==NULL) { 
                pHead = pTail = n; 
                return n; 
            }

            n->next = pHead;
            n->prev = NULL;
            pHead->prev = n;
            pHead = n;
            return n;
        }

        Node* AddAtEnd(Node* n) {
            size++;

            if (pHead==NULL) { 
                pHead = pTail = n; 
                return n; 
            }

            pTail->next = n;
            n->prev = pTail;
            n->next = NULL;
            pTail = n;
        }

        void Unlink(Node* n){
            Node* before = n->prev;
            Node* after = n->next;

            if (before){
                before->next = after;  
            }

            if (after){ 
                after->prev = before;
            }

            if(pHead == n){
                pHead = pHead->next;
            }else if(pTail == n) {
                pTail = pTail->prev;
            }

            size--;
        }

        void Delete(Node* n){
            Unlink(n);
            delete n;
        }

        void TakeToBegin(Node* n){
            Unlink(n);
            AddAtBegin(n);
        } 

        Node* GetTailNode() {
            return pTail;
        } 

        void DeleteLast() {
            Delete(pTail);
        } 

        void Print(){
            Node* p = pHead;
            while(p!=NULL) {
                cout << "(" << p->key << "," << p->value << ") ";
                p = p->next;
            }
            cout << endl;
        }
};



class LRUCache{

    private:
        //cacheList - store the date
        DoubleLinkedList cacheList;
        //cacheMap - index the date for searching
        map<int, Node*> cacheMap;
        //the max capcity of cache
        int capacity;

    public:
        LRUCache(int capacity) {
            this->capacity = capacity;    
        }
        void print(){
            cacheList.Print();
        }

        int get(int key) {
            // The accessed node must be up-to-time -- take to the front 
            if (cacheMap.find(key) != cacheMap.end() ){
                cacheList.TakeToBegin(cacheMap[key]);
                return cacheMap[key]->value;
            }
            return -1;

        }

        void set(int key, int value) {
            // key found, update the data, and take to the front 
            if (cacheMap.find(key) != cacheMap.end() ){
                Node *p = cacheMap[key];
                p->value = value;
                cacheList.TakeToBegin(cacheMap[key]);
            }else{
                // key not found, new a node to store data
                cacheMap[key] = cacheList.NewAtBegin(key, value);
                // if the capacity exceed, remove the last one.
                if( cacheList.Size() > capacity) {
                    int key = cacheList.GetTailNode()->key; 
                    cacheMap.erase(key);
                    cacheList.DeleteLast();
                }
            }
        }
};


int main(int argc, char** argv) 
{

    /*
    LRUCache c(2);
    c.set(2,1);
    c.print();
    c.set(2,2);
    c.print();
    c.get(2);
    c.print();
    c.set(1,1);
    c.print();
    c.set(4,1);
    c.print();
    c.get(2);
    c.print();

    cout << "---------" << endl;
    */
    srand(time(0));

    int capacity = 5;
    int test_loop_times = 10;
    if (argc>1){
        capacity = atoi(argv[1]);
    }
    if (argc>2){
        test_loop_times = atoi(argv[1]);
    }

    LRUCache cache(capacity);

    int v; 
    for(int i=0; i<test_loop_times; i++) {
        v = i;//rand() % capacity;
        cout << "set " << v << ": ";
        cache.set(v, v);
        cache.print();

        v = rand() % capacity;
        cout << "get " << v << ": " << cache.get(v);
        cache.print();

        cout << endl;
    }
    return 0;
}


================================================
FILE: algorithms/cpp/NumberOfWaysToSplitString/NumberOfWaysToSplitString.cpp
================================================
// Source : https://leetcode.com/problems/number-of-ways-to-split-a-string/
// Author : Sudesh Chaudhary
// Date   : 2020-10-01

/************************************************************************************************
*     Given a binary string s (a string consisting only of '0's and '1's), we can split s into 3 non-empty strings s1, s2, s3 (s1+   *      s2+ s3 = s).
*
*     Return the number of ways s can be split such that the number of characters '1' is the same in s1, s2, and s3.
*
*     Since the answer may be too large, return it modulo 10^9 + 7.
*
*     Example 1:
*
*     Input: s = "10101"
*     Output: 4
*     Explanation: There are four ways to split s in 3 parts where each part contain the same number of letters '1'.
*     "1|010|1"
*     "1|01|01"
*     "10|10|1"
*     "10|1|01"
*
*
*      Example 2:
*
*      Input: s = "1001"
*      Output: 0
*
*      Example 3:
*
*      Input: s = "0000"
*      Output: 3
*      Explanation: There are three ways to split s in 3 parts.
*      "0|0|00"
*      "0|00|0"
*      "00|0|0"
*
*      Example 4:
*
*      Input: s = "100100010100110"
*      Output: 12
***************************************************************************************************/

// solution->

// time O(n) space O(n)

#define mod (long long)(1e9+7)
#define ll long long
class Solution {
public:
    int numWays(string s) {

        int n = s.size();

        vector<int> pre(n),suf(n),last(n);
        int count=0;

        for(int i=0;i<n;i++){
            if(s[i]=='1'){
                count++;
            }
            pre[i]=count;
        }

        // check if it can't be divided into three parts
        if(count%3!=0)
            return 0;

        int k  = count/3;
        count=0;
        int t=0;

        for(int i=n-1;i>=0;i--){
            if(s[i]=='1')
                count++;
            suf[i]=count;
        }

        count=0;

        for(int i=n-1;i>=0;i--){

            if(suf[i]==k)
                count++;
            last[i]=count;
        }

        ll res=0;

        for(int i=0;i<n-1;i++){

            if(pre[i]==k){

                if(k!=0)
                    res= (res+last[i+1])%mod;
                else
                    res=(res+last[i+1]-1)%mod;
            }
        }

        return res;
    }
};


================================================
FILE: algorithms/cpp/UTF8Validation/UTF8Validation.cpp
================================================
// Source : https://leetcode.com/problems/utf-8-validation/
// Author : Hao Chen
// Date   : 2016-09-08

/*************************************************************************************** 
 *
 * A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:
 * 
 * For 1-byte character, the first bit is a 0, followed by its unicode code.
 * For n-bytes character, the first n-bits are all one's, the n+1 bit is 0, followed by 
 * n-1 bytes with most significant 2 bits being 10.
 * 
 * This is how the UTF-8 encoding would work:
 * 
 *    Char. number range  |        UTF-8 octet sequence
 *    --------------------+---------------------------------------------
 *    0000 0000-0000 007F | 0xxxxxxx
 *    0000 0080-0000 07FF | 110xxxxx 10xxxxxx
 *    0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
 *    0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
 * 
 * Given an array of integers representing the data, return whether it is a valid utf-8 
 * encoding.
 * 
 * Note:
 * The input is an array of integers. Only the least significant 8 bits of each integer 
 * is used to store the data. This means each integer represents only 1 byte of data.
 * 
 * Example 1:
 * 
 * data = [197, 130, 1], which represents the octet sequence: 11000101 10000010 
 * 00000001.
 * 
 * Return true.
 * It is a valid utf-8 encoding for a 2-bytes character followed by a 1-byte character.
 * 
 * Example 2:
 * 
 * data = [235, 140, 4], which represented the octet sequence: 11101011 10001100 
 * 00000100.
 * 
 * Return false.
 * The first 3 bits are all one's and the 4th bit is 0 means it is a 3-bytes character.
 * The next byte is a continuation byte which starts with 10 and that's correct.
 * But the second continuation byte does not start with 10, so it is invalid.
 ***************************************************************************************/


class Solution {
public:
    bool validUtf8(vector<int>& data) {
        int i = 0;
        while ( i < data.size() ) {
            if ( (data[i] & 0x80) == 0 ){
                i++;
                continue;
            }
            
            int len = 0;
            if ( (data[i] & 0xE0) == 0xC0 ) { // checking 110xxxxx
                len = 2;
            }else if ( (data[i] & 0xF0) == 0xE0) { // checking 1110xxxx
                len = 3;
            }else if ( (data[i] & 0xF8) == 0xF0) { // checking 11110xxx
                len = 4;
            }else {
                return false;
            }
            
            // invalid utf-8 as it doesn't have enough 10xxxxxx
            if (i + len > data.size()) {
                return false;
            }
            
            for (int j=i+1; j < i+len; j++) { //checking 10xxxxxx
                if ( (data[j] & 0xC0) != 0x80 ) {
                    return false;
                }
            }
            
            i += len ;
        }
        return true;
    }
};


================================================
FILE: algorithms/cpp/accountsMerge/AccountsMerge.cpp
================================================
// Source : https://leetcode.com/problems/accounts-merge/
// Author : Hao Chen
// Date   : 2019-03-29

/***************************************************************************************************** 
 *
 * Given a list accounts, each element accounts[i] is a list of strings, where the first element 
 * accounts[i][0] is a name, and the rest of the elements are emails representing emails of the 
 * account.
 * 
 * Now, we would like to merge these accounts.  Two accounts definitely belong to the same person if 
 * there is some email that is common to both accounts.  Note that even if two accounts have the same 
 * name, they may belong to different people as people could have the same name.  A person can have 
 * any number of accounts initially, but all of their accounts definitely have the same name.
 * 
 * After merging the accounts, return the accounts in the following format: the first element of each 
 * account is the name, and the rest of the elements are emails in sorted order.  The accounts 
 * themselves can be returned in any order.
 * 
 * Example 1:
 * 
 * Input: 
 * accounts = [["John", "johnsmith@mail.com", "john00@mail.com"], ["John", "johnnybravo@mail.com"], 
 * ["John", "johnsmith@mail.com", "john_newyork@mail.com"], ["Mary", "mary@mail.com"]]
 * Output: [["John", 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com'],  ["John", 
 * "johnnybravo@mail.com"], ["Mary", "mary@mail.com"]]
 * 
 * Explanation: 
 * The first and third John's are the same person as they have the common email "johnsmith@mail.com".
 * The second John and Mary are different people as none of their email addresses are used by other 
 * accounts.
 *
 * We could return these lists in any order, for example the answer [['Mary', 'mary@mail.com'], 
 * ['John', 'johnnybravo@mail.com'], 
 * ['John', 'john00@mail.com', 'john_newyork@mail.com', 'johnsmith@mail.com']] would still be accepted.
 * 
 * Note:
 * The length of accounts will be in the range [1, 1000].
 * The length of accounts[i] will be in the range [1, 10].
 * The length of accounts[i][j] will be in the range [1, 30].
 ******************************************************************************************************/


//Bad Performance Solution
class Solution_Time_Limit_Exceeded {
public:
    // We can orginze all relevant emails to a chain,
    // then we can use Union Find algorithm
    // Besides, we also need to map the relationship between name and email.
    vector<vector<string>> accountsMerge(vector<vector<string>>& accounts) {
        unordered_map<string, string> emails_chains; // email chains
        unordered_map<string, string> names; // names to email chains' head

        //initialization
        for(int i = 0 ; i<accounts.size();i++) {
            auto& account = accounts[i];
            auto& name = account[0];
            for (int j=1; j<account.size(); j++) {
                auto& email = account[j];
                if ( names.find(email) == names.end() ) {
                    emails_chains[email] = email;
                    names[email] = name;
                }
                join(emails_chains, account[1], email);
            }
        }

        //reform the emails
        unordered_map<string, set<string>> res;
        for( auto& acc : accounts ) {
            string e = find(emails_chains, acc[1]);
            res[e].insert(acc.begin()+1, acc.end());
        }

        //output the result
        vector<vector<string>> result;
        for (auto pair : res) {
            vector<string> emails(pair.second.begin(), pair.second.end());
            emails.insert(emails.begin(), names[pair.first]);
            result.push_back(emails);
        }
        return result;
    }

    string find(unordered_map<string, string>& emails_chains,
                string email) {
        while( email != emails_chains[email] ){
            email = emails_chains[email];
        }
        return email;
    }

    bool join(unordered_map<string, string>& emails_chains,
              string& email1, string& email2) {
        string e1 = find(emails_chains, email1);
        string e2 = find(emails_chains, email2);
        if ( e1 != e2 )  emails_chains[e1] = email2;
        return e1 == e2;
    }
};

//
// Performance Tunning
// -----------------
//
// The above algorithm need to do string comparison, it causes lots of efforts
// So, we allocated the ID for each email, and compare the ID would save the time.
//
// Furthermore, we can use the Group-Email-ID instead of email ID,
// this would save more time.
//
class Solution {
public:
    // We can orginze all relevant emails to a chain,
    // then we can use Union Find algorithm
    // Besides, we also need to map the relationship between name and email.
    vector<vector<string>> accountsMerge(vector<vector<string>>& accounts) {
        unordered_map<string, int> emails_id; //using email ID for union find
        unordered_map<int, int> emails_chains; // email chains
        unordered_map<int, string> names; // email id & name

        //initialization & join
        for(int i = 0 ; i<accounts.size();i++) {

            // using the account index as the emails group ID,
            // this could simplify the emails chain.
            emails_chains[i] = i;

            auto& account = accounts[i];
            auto& name = account[0];
            for (int j=1; j<account.size(); j++) {
                auto& email = account[j];
                if ( emails_id.find(email) == emails_id.end() ) {
                    emails_id[email] = i;
                    names[i] = name;
                }else {
                    join( emails_chains, i, emails_id[email] );
                }

            }
        }

        //reform the emails
        unordered_map<int, set<string>> res;
        for(int i=0; i<accounts.size(); i++) {
            int idx = find(emails_chains, i);
            res[idx].insert(accounts[i].begin()+1, accounts[i].end());
        }


        //output the result
        vector<vector<string>> result;
        for (auto pair : res) {
            vector<string> emails( pair.second.begin(), pair.second.end() );
            emails.insert(emails.begin(), names[pair.first]);
            result.push_back(emails);
        }
        return result;
    }

    int find(unordered_map<int, int>& emails_chains, int id) {
        while( id != emails_chains[id] ){
            id = emails_chains[id];
        }
        return id;
    }

    bool join(unordered_map<int, int>& emails_chains, int id1, int id2) {
        int e1 = find(emails_chains, id1);
        int e2 = find(emails_chains, id2);
        if ( e1 != e2 )  emails_chains[e1] = e2;
        return e1 == e2;
    }
};


================================================
FILE: algorithms/cpp/addAndSearchWord/AddAndSearchWord.cpp
================================================
// Source : https://leetcode.com/problems/add-and-search-word-data-structure-design/
// Author : Hao Chen
// Date   : 2015-06-10

/********************************************************************************** 
 * 
 * Design a data structure that supports the following two operations:
 * 
 * void addWord(word)
 * bool search(word)
 * 
 * search(word) can search a literal word or a regular expression string containing only letters `a-z` or `.`
 * A `.` means it can represent any one letter.
 * 
 * For example:
 * 
 *   addWord("bad")
 *   addWord("dad")
 *   addWord("mad")
 *   search("pad") -> false
 *   search("bad") -> true
 *   search(".ad") -> true
 *   search("b..") -> true
 * 
 * Note:
 * You may assume that all words are consist of lowercase letters a-z.
 * 
 * click to show hint.
 * 
 * You should be familiar with how a Trie works. If not, please work on this problem: Implement Trie (Prefix Tree) first.
 * 
 *               
 **********************************************************************************/
#include <string.h>
#include <iostream>
#include <string>
using namespace std;

const int MAX_CHARS = 26;

/*Trie Node*/
class TrieNode {
public:
    TrieNode():isWord(false) {
        memset(childern, 0, sizeof(childern));
    }
    TrieNode* & operator [] (char idx){
        int i = (idx-'a') % MAX_CHARS;
        return childern[i];
    }
    TrieNode* & operator [] (int idx){
        int i = idx % MAX_CHARS;
        return childern[i];
    }
    bool isWord;
private:
    TrieNode* childern[MAX_CHARS];
};


/*Trie Tree*/
class TrieTree {
public:
    TrieTree():root(new TrieNode()){ }
    ~TrieTree() { freeTree(root); }
    
    void put(string &s) {
        TrieNode* node = root;
        for (int i=0; i<s.size(); i++){
            if ((*node)[s[i]] == NULL){
                (*node)[s[i]] = new TrieNode();
            }
            node = (*node)[s[i]];
        }
        node->isWord = true;
    }
    bool search(string &s){
        return get(s, this->root);
    }

private:

    bool get(string &s, TrieNode* root, int idx=0){
        TrieNode* node = root;
        for (int i=idx; i<s.size(); i++){
            if (s[i]!='.'){
                node = (*node)[s[i]];
                if (node == NULL) return false;
            }else{
                for (int j=0; j<MAX_CHARS; j++) {
                    TrieNode *p = (*node)[j];
                    if (p == NULL ) {
                        continue;//try next
                    }
                    // p!=NULL
                    if (i<s.size()-1) {
                        if (this->get(s, p, i+1)) {
                            return true;
                        }
                        continue; //try next
                    }
                    // p!=NULL && i == s.size()-1
                    if (p->isWord) {
                        return true;
                    }
                }
                return false;
            }
        }
        return node->isWord; 
    }
    
private:
    void freeTree(TrieNode* root){
        for(int i=0; i<MAX_CHARS; i++){
            if ((*root)[i]!=NULL){
                freeTree((*root)[i]);
            }
        }
        delete root;
    }
    TrieNode *root;
};

class WordDictionary {
public:

    // Adds a word into the data structure.
    void addWord(string word) {
        tree.put(word);
    }

    // Returns if the word is in the data structure. A word could
    // contain the dot character '.' to represent any one letter.
    bool search(string word) {
        return tree.search(word);
    }
private:
    TrieTree tree;
};

// Your WordDictionary object will be instantiated and called as such:
// WordDictionary wordDictionary;
// wordDictionary.addWord("word");
// wordDictionary.search("pattern");

int main()
{
    WordDictionary wd;
    wd.addWord("a");
    cout << wd.search("a.") <<endl;;
    cout << wd.search(".a") << endl;;
    wd.addWord("bad");
    cout << wd.search("bad") <<endl;;
    cout << wd.search("b..") <<endl;;
    return 0;
}





================================================
FILE: algorithms/cpp/addBinary/addBinary.cpp
================================================
// Source : https://oj.leetcode.com/problems/add-binary/
// Author : Hao Chen
// Date   : 2014-07-05

/********************************************************************************** 
* 
* Given two binary strings, return their sum (also a binary string).
* 
* For example,
* a = "11"
* b = "1"
* Return "100".
* 
*               
**********************************************************************************/

#include <iostream>
#include <string>
using namespace std;

string addBinary(string a, string b) {
    int alen = a.size();
    int blen = b.size();
    bool carry = false;
    string result;
    while( alen>0 || blen>0) {
        int abit = alen<=0 ? 0 : a[alen-1]-'0';
        int bbit = blen<=0 ? 0 : b[blen-1]-'0';
        int cbit = carry ? 1 : 0;
        result.insert(result.begin(), '0' + ((abit+bbit+cbit) & 1) );
        carry = (abit+bbit+cbit>1);
        alen--; blen--;
    }
    if (carry){
        result.insert(result.begin(), '1');
    }
    return result;
}


int main(int argc, char** argv) 
{
    string a = "11";
    string b = "1";
    if (argc>2){
        a = argv[1];
        b = argv[2];
    }

    cout << a << "+" << b << "=" << addBinary(a, b) << endl;
    
}


================================================
FILE: algorithms/cpp/addDigits/addDigits.cpp
================================================
// Source : https://leetcode.com/problems/add-digits/
// Author : Timothy Lim, Hao Chen
// Date   : 2015-10-1

/********************************************************************************** 
 * Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.
 *
 * For example:
 * Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it.
 *
 * Follow up:
 * 	Could you do it without any loop/recursion in O(1) runtime?
 *
 **********************************************************************************/

class Solution {
    public:

        int addDigits(int num) {
            switch(random()%5+1){
                case 1: return addDigits01(num);
                case 2: return addDigits02(num);
                case 3: return addDigits03(num);
                case 4: return addDigits04(num);
                default: return addDigits05(num);
            }

        }

        //regualr way
        int addDigits01(int num) {
            while(num > 9) {
                int sum;
                for(sum=0; num > 0; sum += num%10 , num/=10);
                num = sum;
            }
            return num;

        }

        //This solution looks is very tricky, but acutally it is easy to understand.
        //it just keep adding the last digital until the num < 10
        int addDigits02(int num) {
            while(num > 9) {
                num = num / 10 + num % 10;
            }
            return num;

        }

        // Let's observe the pattern
        //    1    1
        //    2    2
        //    ... ...
        //    8    8    
        //    9    9    
        //    10    1
        //    11    2
        //    12    3    
        //    ... ...
        //    17    8
        //    18    9
        //    19    1
        //    20    2
        //    ...  ...
        // It looks most of number just simply %9 is the answer, 
        // but there are some edge cases.
        //    9%9=0 but we need 9. 
        //    18%9=0 but we need 9
        // so we can find the solution is:
        //    1) num <=9, return num
        //    2) num > 9, reutrn num%9 if num%9>0
        //                return 9 if num%9 ==0
        int addDigits03(int num) {
            return num >9 ? ((num %9)==0 ? 9:num%9) : num;
        }

        //But actually, we can use (num-1)%9 + 1 to make all cases right.
        int addDigits04(int num){
            return (num - 1) % 9 + 1;
        }

        //This solution is similar with pervious solution.
        int addDigits05(int num){
            return num - 9 * ((num - 1)/9);
        }

};


================================================
FILE: algorithms/cpp/addStrings/AddStrings.cpp
================================================
// Source : https://leetcode.com/problems/add-strings/
// Author : Hao Chen
// Date   : 2016-11-12

/*************************************************************************************** 
 *
 * Given two non-negative numbers num1 and num2 represented as string, return the sum 
 * of num1 and num2.
 * 
 * Note:
 * 
 * The length of both num1 and num2 is 
 * Both num1 and num2 contains only digits 0-9.
 * Both num1 and num2 does not contain any leading zero.
 * You must not use any built-in BigInteger library or convert the inputs to integer 
 * directly.
 ***************************************************************************************/

class Solution {
public:
    string addStrings(string num1, string num2) {
        string& longstr  = ( num1.size() >= num2.size() ? num1 : num2 );
        string& shortstr = ( num1.size() <  num2.size() ? num1 : num2 );
        
        int longlen = longstr.size();
        int shortlen = shortstr.size();
        
        char carry = 0;
        int i, j;
        
        string result;
        for (i = longlen-1, j=shortlen-1; i>=0; i--, j--) {
            int add = 0;
            if (j>=0) {
                add = longstr[i] + shortstr[j] - 2 * '0' + carry;
            }else{
                add = longstr[i] - '0' + carry;
            }
            carry = add/10;
            result = char('0' + add % 10) + result;
        }
        
        if (carry) {
            result = '1' + result;
        }
        return result;
    }
};


================================================
FILE: algorithms/cpp/addToArrayFormOfInteger/AddToArrayFormOfInteger.cpp
================================================
// Source : https://leetcode.com/problems/add-to-array-form-of-integer/
// Author : Hao Chen
// Date   : 2019-03-25

/***************************************************************************************************** 
 *
 * For a non-negative integer X, the array-form of X is an array of its digits in left to right order. 
 *  For example, if X = 1231, then the array form is [1,2,3,1].
 * 
 * Given the array-form A of a non-negative integer X, return the array-form of the integer X+K.
 * 
 * Example 1:
 * 
 * Input: A = [1,2,0,0], K = 34
 * Output: [1,2,3,4]
 * Explanation: 1200 + 34 = 1234
 * 
 * Example 2:
 * 
 * Input: A = [2,7,4], K = 181
 * Output: [4,5,5]
 * Explanation: 274 + 181 = 455
 * 
 * Example 3:
 * 
 * Input: A = [2,1,5], K = 806
 * Output: [1,0,2,1]
 * Explanation: 215 + 806 = 1021
 * 
 * Example 4:
 * 
 * Input: A = [9,9,9,9,9,9,9,9,9,9], K = 1
 * Output: [1,0,0,0,0,0,0,0,0,0,0]
 * Explanation: 9999999999 + 1 = 10000000000
 * 
 * Note:
 * 
 * 	1 <= A.length <= 10000
 * 	0 <= A[i] <= 9
 * 	0 <= K <= 10000
 * 	If A.length > 1, then A[0] != 0
 * 
 ******************************************************************************************************/

class Solution {
public:
    vector<int> addToArrayForm(vector<int>& A, int K) {
        int carry = K;
        for (int i = A.size() - 1; i >= 0 && carry > 0; i--) {
            int a = A[i] + carry;
            A[i] = a % 10 ;
            carry = a / 10;
        }

        while ( carry > 0 ) {
            A.insert(A.begin(), carry%10);
            carry /= 10;
        }

        return A;
    }
};


================================================
FILE: algorithms/cpp/addTwoNumbers/addTwoNumbers.cpp
================================================
// Source : https://oj.leetcode.com/problems/add-two-numbers/
// Author : Hao Chen
// Date   : 2014-06-18

/********************************************************************************** 
* 
* You are given two linked lists representing two non-negative numbers. 
* The digits are stored in reverse order and each of their nodes contain a single digit. 
* Add the two numbers and return it as a linked list.
* 
* Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
* Output: 7 -> 0 -> 8
*               
**********************************************************************************/

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution {
    
public:
    ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) {
        int x=0, y=0, carry=0, sum=0;
        ListNode *h=NULL, **t=&h;
        
        while (l1!=NULL || l2!=NULL){
            x = getValueAndMoveNext(l1);
            y = getValueAndMoveNext(l2);
            
            sum = carry + x + y;
            
            ListNode *node = new ListNode(sum%10);
            *t = node;
            t = (&node->next);
            
            carry = sum/10;
        }
        
        if (carry > 0) {
            ListNode *node = new ListNode(carry%10);
            *t = node;
        }
        
        return h;
    }
private:
    int getValueAndMoveNext(ListNode* &l){
        int x = 0;
        if (l != NULL){
            x = l->val;
            l = l->next;
        }
        return x;
    }
};


================================================
FILE: algorithms/cpp/additiveNumber/AdditiveNumber.cpp
================================================
// Source : https://leetcode.com/problems/additive-number/
// Author : Hao Chen
// Date   : 2015-11-22

/*************************************************************************************** 
 *
 * Additive number is a positive integer whose digits can form additive sequence.
 * 
 * A valid additive sequence should contain at least three numbers. Except for the 
 * first two numbers, each subsequent number in the sequence must be the sum of the 
 * preceding two.
 * 
 * For example:
 * "112358" is an additive number because the digits can form an additive sequence: 1, 
 * 1, 2, 3, 5, 8.
 * 1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8
 * "199100199" is also an additive number, the additive sequence is: 1, 99, 100, 199.
 * 1 + 99 = 100, 99 + 100 = 199
 * 
 * Note: Numbers in the additive sequence cannot have leading zeros, so sequence 1, 2, 
 * 03 or 1, 02, 3 is invalid.
 * 
 * Given a string represents an integer, write a function to determine if it's an 
 * additive number.
 * 
 * Follow up:
 * How would you handle overflow for very large input integers?
 * 
 * Credits:Special thanks to @jeantimex for adding this problem and creating all test 
 * cases.
 *               
 ***************************************************************************************/


class Solution {
public:
    bool isAdditiveNumber(string num) {
        int len = num.size();
        
        for(int i=1; i<len/2+1; i++) {
            string n1 = num.substr(0, i);
            if ( n1.size()>1 && n1[0] == '0') break;
            for(int j=i+1; j<len; j++) {
                string n2 = num.substr(i, j-i);
                if ( n2.size()>1 && n2[0] == '0') break;
                string n3 = num.substr(j);
                if (isAdditiveNumberHelper(n1, n2, n3)) return true;
            }
        }
        return false;
    }
    
private:
    bool isAdditiveNumberHelper(string& n1, string& n2, string& n3){
        string add = StringAdd(n1, n2);
        
        if (add.size() > n3.size()) return false;
        
        if (add == n3 ) return true;
        
        //split the n3 to 2 parts, and keep going.
        string cut = n3.substr(0, add.size());
        if (add == cut) {
            string rest = n3.substr(add.size());
            return isAdditiveNumberHelper(n2, add, rest);
        }
        return false;
    }


    string StringAdd(string n1, string n2) {
        
        if (n1.size() < n2.size()) {
            string tmp = n1;
            n1 = n2;
            n2 = tmp;
        }
        
        int carry=0;
        string result;
        for (int i=n1.size()-1, j=n2.size()-1; i>=0; i--, j--) {

            int n = n1[i] - '0' + carry;
            if ( j >= 0) {
                n += n2[j] - '0';
            } 
            char ch = n % 10 + '0';
            carry = n/10;
            result = ch + result;
        }
        if (carry>0) result = (char)(carry+'0') + result;
        return result;
        
    }
};


================================================
FILE: algorithms/cpp/anagrams/GroupAnagrams.cpp
================================================
// Source : https://oj.leetcode.com/problems/anagrams/
// Author : Hao Chen
// Date   : 2014-07-18

/********************************************************************************** 
 * 
 * Given an array of strings, group anagrams together.
 * 
 * For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], 
 * Return:
 * 
 * [
 *   ["ate", "eat","tea"],
 *   ["nat","tan"],
 *   ["bat"]
 * ]
 * 
 * Note:
 * 
 * For the return value, each inner list's elements must follow the lexicographic order.
 * All inputs will be in lower-case.
 * 
 * Update (2015-08-09):
 * The signature of the function had been updated to return list<list<string>> instead 
 * of list<string>, as suggested here. If you still see your function signature return 
 * a list<string>, please click the reload button  to reset your code definition.
 * 
 **********************************************************************************/

class Solution {
public:
    vector< vector<string> > groupAnagrams(vector<string> &strs) {
        vector< vector<string> > result;
        map<string, int> m;
        for(int i=0; i<strs.size(); i++){
            string word = strs[i];
            sort(word.begin(), word.end());
            if (m.find(word)==m.end()){
                vector<string> v;
                v.push_back(strs[i]);
                result.push_back(v);
                m[word] = result.size()-1;
                
            }else{
                result[m[word]].push_back(strs[i]);
            }
        }
        
        for(int i=0; i<result.size(); i++){
            sort(result[i].begin(), result[i].end());
        }
        return result;
    }
     
    //using multiset 
    vector< vector<string> > groupAnagrams01(vector<string> &strs) {
        vector< vector<string> > result;
        map<string, multiset<string>> m;
        for(int i=0; i<strs.size(); i++){
            string word = strs[i];
            sort(word.begin(), word.end());
            m[word].insert(strs[i]);
        }
        
        for(auto item : m){
            vector<string> v(item.second.begin(), item.second.end());
            result.push_back(v);
        }
        return result;
    }


    //NOTICE: the below solution has been depracated as the problem has been updated!
    vector<string> anagrams(vector<string> &strs) {
        vector<string> result;
        map<string, int> m;
        for(int i=0; i<strs.size(); i++){
            string word = strs[i];
            //sort it can easy to check they are anagrams or not
            sort(word.begin(), word.end());  
            if (m.find(word)==m.end()){
                m[word] = i;
            }else{
                if (m[word]>=0){
                    result.push_back(strs[m[word]]);
                    m[word]=-1;
                }
                result.push_back(strs[i]);
            }
        }
        return result;
    }
};


================================================
FILE: algorithms/cpp/anagrams/ValidAnagram.cpp
================================================
// Source : https://leetcode.com/problems/valid-anagram/
// Author : Hao Chen
// Date   : 2015-08-16

/********************************************************************************** 
 * 
 * Given two strings s and t, write a function to determine if t is an anagram of s. 
 * 
 * For example,
 * s = "anagram", t = "nagaram", return true.
 * s = "rat", t = "car", return false.
 * 
 * Note:
 * You may assume the string contains only lowercase alphabets.
 *               
 **********************************************************************************/


class Solution {
public:

    //stupid way - but easy to understand  - 76ms
    bool isAnagram01(string s, string t) {
        sort(s.begin(), s.end());
        sort(t.begin(), t.end());
        return s == t;
    }
    
    //using a map to count every chars in the string.
    bool isAnagram02(string s, string t) {
        int map[26] ={0} ; //only lowercase alphabets
        //memset(map, 0, sizeof(map));
        
        // count each char for s
        for (int i=0; i<s.size(); i++) {
            map[s[i]-'a']++;
        }
        // decrease the count for t
        for (int i=0; i<t.size(); i++) {
            map[t[i]-'a']--;
        }
        
        //if all alphabets is zero, then they are anagram 
        for (int i=0; i<sizeof(map)/sizeof(map[0]); i++) {
            if (map[i]!=0) return false;
        }
        return true;
    }
    

    
    bool isAnagram(string s, string t) {
        return isAnagram02(s,t); //12ms
        return isAnagram01(s,t); //76ms
    }
    
};





================================================
FILE: algorithms/cpp/arithmeticSlices/ArithmeticSlices.cpp
================================================
// Source : https://leetcode.com/problems/arithmetic-slices/
// Author : Hao Chen
// Date   : 2016-11-13

/*************************************************************************************** 
 *
 * A sequence of number is called arithmetic if it consists of at least three elements 
 * and if the difference between any two consecutive elements is the same.
 * 
 * For example, these are arithmetic sequence:
 * 1, 3, 5, 7, 9
 * 7, 7, 7, 7
 * 3, -1, -5, -9
 * 
 * The following sequence is not arithmetic. 1, 1, 2, 5, 7 
 * 
 * A zero-indexed array A consisting of N numbers is given. A slice of that array is 
 * any pair of integers (P, Q) such that 0 
 * 
 * A slice (P, Q) of array A is called arithmetic if the sequence:
 *     A[P], A[p + 1], ..., A[Q - 1], A[Q] is arithmetic. In particular, this means 
 * that P + 1 
 * 
 * The function should return the number of arithmetic slices in the array A. 
 * 
 * Example:
 * 
 * A = [1, 2, 3, 4]
 * 
 * return: 3, for 3 arithmetic slices in A: [1, 2, 3], [2, 3, 4] and [1, 2, 3, 4] 
 * itself.
 ***************************************************************************************/

class Solution {
public:
    //
    // It's easy to find out how many 3-length slices in an arithmetic array with N length.
    //
    //   len = 3, then  1 slices, sum(1)
    //   len = 4, then  3 slices, sum(1,2) - TWO 3-length slices + ONE 4-length slice
    //   len = 5, then  6 slices, sum(1,2,3) - THREE 3-length slices + TWO 4-length slices + ONE 5-length slice
    //   len = 6, then 10 slices, sum(1,2,3,4) - ...
    //   len = 7, then 15 slices, sum(1,2,3,4,5) - ..
    //
    // So, with N length arithmetic array, there are Sum[1, N-3+1] 3-length slices
    //
    // And, we know the formula sum from 1 to n is:
    //
    //                  n * ( n + 1 )
    //    sum [1, n] = ---------------
    //                       2
    // Then, we could have the solution - O(n) Time with O(1) Space
    //
    
    int sum1toN(int n) {
        return n * (n+1) / 2;
    }

    int numberOfArithmeticSlices(vector<int>& A) {
        int result = 0;
        int len = 0; // the current length of arithmetic
        for (int i=2; i<A.size(); i++) {
            if (A[i] - A[i-1] == A[i-1] - A[i-2]) {
                len++;
            }else{
                result += sum1toN(len);
                len=0;
            }
        }
        return len==0 ? result : result + sum1toN(len);
    }
};


================================================
FILE: algorithms/cpp/backspaceStringCompare/BackspaceStringCompare.cpp
================================================
// Source : https://leetcode.com/problems/backspace-string-compare/description/
// Author : Hao Chen
// Date   : 2018-06-29

/*************************************************************************************** 
 *
 * Given two strings S and T, return if they are equal when both are typed into empty 
 * text editors. # means a backspace character.
 * 
 * 
 * Example 1:
 * 
 * 
 * Input: S = "ab#c", T = "ad#c"
 * Output: true
 * Explanation: Both S and T become "ac".
 * 
 * 
 * 
 * Example 2:
 * 
 * 
 * Input: S = "ab##", T = "c#d#"
 * Output: true
 * Explanation: Both S and T become "".
 * 
 * 
 * 
 * Example 3:
 * 
 * 
 * Input: S = "a##c", T = "#a#c"
 * Output: true
 * Explanation: Both S and T become "c".
 * 
 * 
 * 
 * Example 4:
 * 
 * 
 * Input: S = "a#c", T = "b"
 * Output: false
 * Explanation: S becomes "c" while T becomes "b".
 * 
 * 
 * Note:
 * 
 * 
 * 	1 <= S.length <= 200
 * 	1 <= T.length <= 200
 * 	S and T only contain lowercase letters and '#' characters.
 * 
 * 
 * Follow up:
 * 
 * 
 * 	Can you solve it in O(N) time and O(1) space?
 * 
 * 
 * 
 * 
 ***************************************************************************************/

class Solution {
private:    
    void removeBackspaces(string &s) {
        int i = 0;
        for(int i=0; i<s.size(); i++) {
            if (s[i] == '#') {
                int backSteps = i>0 ? 2 : 1;
                s.erase(i-backSteps + 1, backSteps);
                i -= backSteps;
            } 
        }
    }
    
public:
    bool backspaceCompare(string S, string T) {
        removeBackspaces(S);
        removeBackspaces(T);
        return S == T;
    }
};


================================================
FILE: algorithms/cpp/balancedBinaryTree/balancedBinaryTree.cpp
================================================
// Source : https://oj.leetcode.com/problems/balanced-binary-tree/
// Author : Hao Chen
// Date   : 2014-06-28

/********************************************************************************** 
* 
* Given a binary tree, determine if it is height-balanced.
* 
* For this problem, a height-balanced binary tree is defined as a binary tree in which 
* the depth of the two subtrees of every node never differ by more than 1.
* 
*               
**********************************************************************************/

/**
 * Definition for binary tree
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
class Solution {
public:
    bool isBalanced(TreeNode *root) {
        int height=0;
        return isBalancedUtil(root, height);
    }

    bool isBalancedUtil(TreeNode* root, int& height){
       if(root==NULL){
          height=0;
          return true;
       }
       int lh=0, rh=0;
       bool isLeft = isBalancedUtil(root->left, lh);
       bool isRight = isBalancedUtil(root->right, rh);
       height = (lh > rh ? lh : rh) + 1;
       return (abs(lh-rh)<=1 && isLeft && isRight);
    }

};

//Notes: 
// I think the above solution should be more efficent than the below, 
//  but for leetcode, the below solution needs 60ms, the above needs 88ms
class Solution {
public:
    bool isBalanced(TreeNode *root) {
        if (root==NULL) return true;
        
        int left = treeDepth(root->left); 
        int right = treeDepth(root->right);
        
        if (left-right>1 || left-right < -1) {
            return false;
        }
        return isBalanced(root->left) && isBalanced(root->right);
    }
    
    int treeDepth(TreeNode *root) {
        if (root==NULL){
            return 0;
        }

        int left=1, right=1;
        
        left += treeDepth(root->left);
        right += treeDepth(root->right);
        
        return left>right?left:right;
    }

};


================================================
FILE: algorithms/cpp/basicCalculator/BasicCalculator.II.cpp
================================================
// Source : https://leetcode.com/problems/basic-calculator-ii/
// Author : Hao Chen
// Date   : 2015-06-24

/********************************************************************************** 
 * 
 * Implement a basic calculator to evaluate a simple expression string.
 * 
 * The expression string contains only non-negative integers, +, -, *, / operators and empty spaces  . 
 * The integer division should truncate toward zero.
 * 
 * You may assume that the given expression is always valid.
 * 
 * Some examples:
 * 
 * "3+2*2" = 7
 * " 3/2 " = 1
 * " 3+5 / 2 " = 5
 * 
 * Note: Do not use the eval built-in library function.
 * 
 * Credits:Special thanks to @ts for adding this problem and creating all test cases.
 **********************************************************************************/
#include <iostream>
#include <sstream>
#include <string>
#include <stack>
using namespace std;

/* 
 * Acuatlly, everything I've already implemented in "Basic Calculator"(RPN way and Design pattern way).
 * So, here, I just use the quick-dirty way - just like the "two stacks solution" in "Basic Calulator".
 */


//Quick & Dirty Solution
bool isOperator(const char ch) {
    return (ch=='+' || ch=='-' || ch=='*' || ch=='/');
}


int Priority(const char c) {
    if (c == '*' || c == '/') {
        return 2;
    } else if (c== '+' || c == '-') {
        return 1;
    } else {
        return 0;
    }
}

long long calculate_exp(long long x, long long y, char op) {
    switch(op) {
        case '+': return x + y;
        case '-': return x - y;
        case '*': return x * y;
        case '/': return x / y;
    }
    return -1;
}


//Two Stacks solution
int calculate_two_stacks(string& s) {

    s += "+0";
    stack<long long> num_stack; //put the number
    stack<char> op_stack; //put the operations

    #define CALCULATE_IT { \
        long long y = num_stack.top(); num_stack.pop(); \
        long long x = num_stack.top(); num_stack.pop(); \
        char op = op_stack.top(); op_stack.pop(); \
        num_stack.push(calculate_exp(x, y, op));\
    }

    for(int i = 0; i < s.size(); i++){
        char ch = s[i];
        if (isspace(ch)) continue;
        if (isdigit(ch)) {
            string num;
            num += s[i];
            while(isdigit(s[i+1])){
                num += s[i+1];
                i++;
            }
            num_stack.push(stoll(num));
            continue;
        }
        if (isOperator(ch)) {
            while (!op_stack.empty() && Priority(op_stack.top()) >= Priority(ch) ) {
                CALCULATE_IT;
            }

            op_stack.push(ch);
        }

    }

    while(!op_stack.empty()){
        CALCULATE_IT;
    }
    
    return num_stack.top();
}


int calculate(string s) {
    return calculate_two_stacks(s);
}

int main(int argc, char**argv) 
{
    string exp = " 3+5 / 2 ";
    if (argc>1) {
        exp = argv[1];
    }

    cout << "\"" << exp << "\" = " << calculate(exp) << endl;

}



================================================
FILE: algorithms/cpp/basicCalculator/BasicCalculator.cpp
================================================
// Source : https://leetcode.com/problems/basic-calculator/
// Author : Hao Chen
// Date   : 2015-06-12

/********************************************************************************** 
 * 
 * Implement a basic calculator to evaluate a simple expression string.
 * 
 * The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, 
 * non-negative integers and empty spaces  .
 * 
 * You may assume that the given expression is always valid.
 * 
 * Some examples:
 * 
 * "1 + 1" = 2
 * " 2-1 + 2 " = 3
 * "(1+(4+5+2)-3)+(6+8)" = 23
 * 
 * Note: Do not use the eval built-in library function.
 * 
 *               
 **********************************************************************************/
#include <stdlib.h>
#include <ctype.h>
#include <iostream>
#include <string>
#include <stack>
#include <vector>
using namespace std;

/*
 * Sorry, I cannot help using Design Pattern  ;-)
 * (https://en.wikipedia.org/wiki/Interpreter_pattern)
 *
 * Two Stack is cheap, design pattern is powerful!   ;-)
 * 
 * But WTF, Memory Limit Exceeded!! Shit!!
 */

class Expression 
{
    public:
        virtual int interpret() = 0;
        virtual ~Expression() {};
};

class Number: public Expression 
{

    public:
        Number(string num) { this->number = atoi(num.c_str()); }
        ~Number() { }
        int interpret() { return number; }
    private:
        int number;
};

class Plus : public Expression 
{
    public:
        Plus(Expression* left, Expression* right) :leftOperand(left), rightOperand(right) { } 
        ~Plus() { delete leftOperand; delete rightOperand; }
        int interpret() { return leftOperand->interpret() + rightOperand->interpret(); }
    private:
        Expression* leftOperand;
        Expression* rightOperand;
};

class Minus : public Expression 
{
    public:
        Minus(Expression* left, Expression* right) :leftOperand(left), rightOperand(right) { } 
        ~Minus() { delete leftOperand; delete rightOperand; }
        int interpret() { return leftOperand->interpret() - rightOperand->interpret(); }
    private:
        Expression* leftOperand;
        Expression* rightOperand;
};

class Multiply : public Expression
{
    public:
        Multiply(Expression* left, Expression* right) :leftOperand(left), rightOperand(right) { }
        ~Multiply() { delete leftOperand; delete rightOperand; }
        int interpret() { return leftOperand->interpret() * rightOperand->interpret(); }
    private:
        Expression* leftOperand;
        Expression* rightOperand;
};

class Divide : public Expression
{
    public:
        Divide(Expression* left, Expression* right) :leftOperand(left), rightOperand(right) { }
        ~Divide() { delete leftOperand; delete rightOperand; }
        int interpret() { return leftOperand->interpret() / rightOperand->interpret(); }
    private:
        Expression* leftOperand;
        Expression* rightOperand;
};

bool isOperator(const string &c) {
    return (c == "+" || c == "-" || c == "*" || c == "/" );
}
bool isOperator(const char &c) {
    return (c == '+' || c == '-' || c == '*' || c == '/'); 
}

class Evaluator : public Expression 
{
    private:
        Expression* syntaxTree;

    public: 
        Evaluator(vector<string>& s) 
        {
            vector<Expression*> stack;
            for (unsigned int i=0; i < s.size(); i++) {
                if (isOperator(s[i])) {
                    Expression* left  = stack.back(); stack.pop_back();
                    Expression* right = stack.back(); stack.pop_back();
                    switch(s[i][0]) { 
                        case '+' : 
                            stack.push_back(new Plus(right, left)); break;
                        case '-' :
                            stack.push_back(new Minus(right, left)); break;
                        case '*' :
                            stack.push_back(new Multiply(right, left)); break;
                        case '/' :
                            stack.push_back(new Divide(right, left)); break;
                    }

                }else{                        
                    stack.push_back(new Number(s[i]));
                }
            }
            syntaxTree = stack.back();
        }
        ~Evaluator() {
            delete syntaxTree; 
        }

        int interpret() {
            return syntaxTree->interpret();
        }
};




vector<string> Parse(string& s){
    vector<string> exp;
    for(int i=0; i<s.size(); ){
        char c = s[i];
        string token;
        if (c == '+' || c == '-' || c == '*' || c == '/' || c == '(' || c == ')' ) {
            exp.push_back(token+c);
            i++;
            continue;
        }
        if ( isdigit(c) ) {
            while( isdigit(s[i]) ) {
                token.push_back(s[i++]);
            }
            exp.push_back(token);
            continue;
        }
        i++;
    }
    return exp;
}


int Priority(const string &c) {
    if (c == "*" || c == "/") {
        return 2;
    } else if (c== "+" || c == "-") {
        return 1;
    } else {
        return 0;
    }
}

vector<string> Infix2RPN(vector<string>& infix) {
    vector<string> rpn;
    stack<string> s;

    for(int i = 0; i < infix.size(); i++) {
        if(isdigit(infix[i][0])) { //number
            rpn.push_back(infix[i]);
        } else if (infix[i] == "(") {
            s.push(infix[i]);
        } else if (infix[i] == ")") {
            while(!s.empty() && s.top() != "(") {
                rpn.push_back(s.top());
                s.pop();
            }
            s.pop();
        }else if(isOperator(infix[i]) ){
            while(!s.empty() && Priority(s.top()) >= Priority(infix[i])) {
                rpn.push_back(s.top());
                s.pop();
            }
            s.push(infix[i]);
        }
    }
    while(!s.empty()) {
        rpn.push_back(s.top());
        s.pop();
    }


    return rpn;
}

//Design Pattern for RPN - Memory Limit Exceeded!!
int calculate_RPN_design_pattern(string& s) {
    vector<string> exp = Parse(s);
    //for (int i=0; i<exp.size(); i++){
    //    cout << exp[i] << " ";
    //}
    //cout << endl;
    exp = Infix2RPN(exp);
    for (int i=0; i<exp.size(); i++){
        cout << exp[i] << " ";
    }
    cout << endl;
    Evaluator sentence(exp);
    return sentence.interpret();
}


/*
 *  RPN - Reverse Polish Notation
 *  see:  https://en.wikipedia.org/wiki/Reverse_Polish_notation
 */

//RPN evluation - Memory Limit Exceeded!!
int calculate_RPN_evluation(string& s) {
    vector<string> exp = Parse(s);
    exp = Infix2RPN(exp);

    stack<int> ss;
    for(int i=0; i<exp.size(); i++) {
        if (isdigit(exp[i][0])) { 
            ss.push(atoi(exp[i].c_str()));
        }
        if (exp[i]=="+" || exp[i]=="-") {
            int rhs = ss.top(); ss.pop();
            int lhs = ss.top(); ss.pop();
            if (exp[i]=="-") rhs = -rhs;
            ss.push(lhs + rhs);
        }
    }
    return ss.top();
}



//Two stack solution - quick & dirty solution
inline void calculate_two_stacks(stack<int>& num_stack, stack<char>& op_stack) {
    int lhs = num_stack.top(); num_stack.pop();
    int rhs = num_stack.top(); num_stack.pop();
    char op = op_stack.top(); op_stack.pop();
    if (op=='-') rhs = -rhs;
    num_stack.push(lhs + rhs);
}
int calculate_two_stacks(string& s) {
    stack<int> num_stack; //put the number
    stack<char> op_stack; //put the operations

    for(int i = s.size() - 1; i >= 0; i--){
        if(s[i] == ')' || s[i] == '+' || s[i] == '-') {
            op_stack.push(s[i]);
        } else if(isdigit(s[i])){
            string num;
            num += s[i];
            while(isdigit(s[i-1])){
                num.insert(num.begin(), s[i-1]);
                i--;
            }
            num_stack.push(atoi(num.c_str())); 
        } else if(s[i] == '('){
            while(op_stack.top() != ')') {
                calculate_two_stacks(num_stack, op_stack);
            }
            op_stack.pop();
        }
    }
    while(!op_stack.empty()){ 
        calculate_two_stacks(num_stack, op_stack);
    }
    return num_stack.top();
}


int calculate(string s) {
    return calculate_two_stacks(s);
    return calculate_RPN_evluation(s);
    return calculate_RPN_design_pattern(s);
}

int main(int argc, char** argv) {
    string s = " 15-(1+3)+(2+1) ";
    if (argc >1){
        s = argv[1];
    } 
    cout << s << " = " << calculate(s) << endl;
    cout << "---------------" << endl;
    s = "(2+4)-(6+(1+5))";
    cout << s << " = " << calculate(s) << endl;
}


================================================
FILE: algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithCooldown.cpp
================================================
// Source : https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/
// Author : Hao Chen
// Date   : 2019-02-01

/***************************************************************************************************** 
 *
 * Say you have an array for which the ith element is the price of a given stock on day i.
 * 
 * Design an algorithm to find the maximum profit. You may complete as many transactions as you like 
 * (ie, buy one and sell one share of the stock multiple times) with the following restrictions:
 * 
 * 	You may not engage in multiple transactions at the same time (ie, you must sell the stock 
 * before you buy again).
 * 	After you sell your stock, you cannot buy stock on next day. (ie, cooldown 1 day)
 * 
 * Example:
 * 
 * Input: [1,2,3,0,2]
 * Output: 3 
 * Explanation: transactions = [buy, sell, cooldown, buy, sell]
 ******************************************************************************************************/
class Solution {
public:
    //
    //Define 
    //
    //  - buy[i] as the max profit when you buy the stock at day i. 
    //  - sell[i] as the max profit when you sell the stock at day i. 
    //
    // Therefore set buy[0] = -prices[0], because spend the money, the profit is -prices[0].
    // Also set sell[0] = 0, that you do nothing in the first day.
    //
    // So,
    //     buy[i] = max(buy[i-1],                // do nothing - keep holding
    //                  sell[i-2] - prices[i] )  // sell previous day, buy today
    //                                           // i-1 is cooldown day
    //     sell[i] = max(sell[i-1],              // do nothing 
    //                   buy[i-1] + prices[i] )  // buy previous day, sell today.
    //  
    
    int maxProfit(vector<int>& prices) {
        int len = prices.size();
        if ( len < 2 ) return 0;
        
        vector<int> buy(len, 0);
        vector<int> sell(len, 0);
        
        //day 0
        buy[0] = -prices[0];
        sell[0] = 0;
        
        //day 1
        buy[1] = max(buy[0], 0 - prices[1]);
        sell[1] = max(sell[0], buy[0] + prices[1]);
        
        for (int i=2; i<len; i++) {
            buy[i]  = max( buy[i - 1], sell[i - 2] - prices[i]);   
            sell[i] = max(sell[i - 1],  buy[i - 1] + prices[i]);
        }
        
        return sell[len-1];
    }
};


================================================
FILE: algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithTransactionFee.cpp
================================================
// Source : https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee
// Author : Hao Chen
// Date   : 2019-02-01

/***************************************************************************************************** 
 *
 * Your are given an array of integers prices, for which the i-th element is the price of a given 
 * stock on day i; and a non-negative integer fee representing a transaction fee.
 *
 * You may complete as many transactions as you like, but you need to pay the transaction fee for each 
 * transaction.  You may not buy more than 1 share of a stock at a time (ie. you must sell the stock 
 * share before you buy again.)
 *
 * Return the maximum profit you can make.
 * 
 * Example 1:
 * 
 * Input: prices = [1, 3, 2, 8, 4, 9], fee = 2
 * Output: 8
 *
 * Explanation: The maximum profit can be achieved by:
 * Buying at prices[0] = 1Selling at prices[3] = 8Buying at prices[4] = 4Selling at prices[5] = 9The 
 * total profit is ((8 - 1) - 2) + ((9 - 4) - 2) = 8.
 * 
 * Note:
 * 0 < prices.length <= 50000.
 * 0 < prices[i] < 50000.
 * 0 <= fee < 50000.
 ******************************************************************************************************/



class Solution {
private:
    int max(int x, int y) {
        return x > y ? x: y;
    }
    int max(int x, int y, int z) {
        return max(x, max(y,z));
    }

public:

    int maxProfit(vector<int>& prices, int fee) {
        return maxProfit_dp03(prices, fee); // 100ms
        return maxProfit_dp02(prices, fee); // 100ms
        return maxProfit_dp01(prices, fee); // 2700ms
    }

    // find the [buy-low, sell-high] prices pairs,
    // and remove the unnecessary prices.
    void genPricesPairs(vector<int> &prices, vector< pair<int, int> > &prices_pairs, int fee){

        int low = -1;
        for (int i=0; i<prices.size()-1; i++){
            //meet the valley, then goes up
            if (prices[i] < prices[i+1] && low < 0 ) {
                low = i;
            }
            //meet the peak, then goes down
            if (prices[i] > prices[i+1] && low >= 0) {
                prices_pairs.push_back( make_pair( prices[low], prices[i]) );
                low = -1; // reset the `low` & `high`
            }
        }

        // edge case
        if ( low >= 0 ) {
            prices_pairs.push_back( make_pair( prices[low], prices[prices.size()-1] ) );
        }

    }

    int maxProfit_dp01(vector<int> &prices, int &fee) {

        vector< pair<int, int> > prices_pairs;
        genPricesPairs(prices, prices_pairs, fee);

        vector<int> dp(prices_pairs.size()+1, 0);

        for (int i=0; i<prices_pairs.size(); i++) {
            for ( int j=0; j<=i; j++ ) {
                int profit = prices_pairs[i].second - prices_pairs[j].first - fee;
                // if the profit is negative, skip the transaction
                if ( profit < 0 ) profit = 0;
                dp[i+1] = max ( dp[i+1], dp[j] + profit);
            }
        }

        return dp[dp.size()-1];
    }

    int maxProfit_dp02(vector<int> &prices, int &fee) {

        vector< pair<int, int> > prices_pairs;
        genPricesPairs(prices, prices_pairs, fee);

        if ( prices_pairs.size() < 1 ) return 0;


        // first - represent  the max profit if we buy.
        // second - represent the max profit if we sell.
        vector< pair<int,int> > dp(prices_pairs.size() , make_pair(0,0) );

        //buy profit - if we buy it in day 0, then we got negtive profit.
        dp[0].first = - prices_pairs[0].first;

        //sell profit - if we sell it in day 0, then we have the profits
        //              if the profit is negtive, then won't sell it.
        dp[0].second = max(0, prices_pairs[0].second - prices_pairs[0].first - fee);

        for (int i=1; i<prices_pairs.size(); i++) {
            // BUY - we could have three options
            //   1) hold the stock do nothing.  profit = previous day's buy profit
            //   2) sell & buy. profit = previous sell profit - spent money to buy.
            //   3) fresh buy, give up the pervious buy, just buy it today.
            // find the max profit of these 3 options.

            dp[i].first = max (dp[i-1].first,                          // option 1) do nothing
                               dp[i-1].second - prices_pairs[i].first, // option 2) sell & buy
                               - prices_pairs[i].first );              // option 3) fresh buy

            // SELL - we could have three options
            //   1) hold the stock do nothing. profit = previous day's sell profit
            //   2) sell it. profit = previous day's buy + today's sell.
            //   3) sell previous and sell today. profit = previous's sell + today's sell
            // Find the max profit of these 3 options
            dp[i].second = max(dp[i-1].second,
                               dp[i-1].first + prices_pairs[i].second - fee,
                               dp[i-1].second + prices_pairs[i].second - prices_pairs[i].first - fee );
        }

        return max( dp[dp.size()-1].second, 0 );

    }

    //
    // Actually, by given any day, we can have two status:
    // 1) BUY status - we can have two options at Day X.
    //     i) buy stock - need previous sell status.(you cannot buy if you haven't sold)
    //    ii) do nothing - need previous buy status.
    //
    // 2) SELL status - we can have two options at Day X.
    //     i) sell stock - need previous buy status.(you cannot sell if you haven't bought)
    //    ii) do nothing - keep the previous sell status.
    //
    // For example:
    //
    //    if we have [1,3,2,8,4,9], fee = 2
    //    then we could have the following BUY & SELL status
    //
    //    Day One
    //        1 - BUY: the profit is -1 ,becuase we spent 1 money
    //            SELL: you cannot sell, the profit is 0.
    //    Day Two
    //        3 - BUY : pre-SELL - 3 = -3, but do nothing has max profit pre-BUY: -1
    //            SELL: pre-BUY + 3 -2 = -1+3-2 = 0 , the max profit: 0
    //    Day Three
    //        2 - BUY : pre-SELL - 2 = 0 - 2 = -2, do nothing has max profit: -1
    //            SELL: pre-BUY + 2 -2 = -1 + 2 -2 = -1, do nothing has max profit: 0
    //    Day Four
    //        8 - BUY : pre-SELL - 8 =  0 - 8 = -8, so, just hold, the max buy profit: -1
    //            SELL: pre-BUY + 8 - 2 = -1+8-2 =5, the max profit is 5
    //    Day Five
    //        4 - BUY : pre-SELL - 4 = 5-4 = 1, do nothing profit is -1, so should buy it.
    //                  so, the max buy profit is 1.
    //            SELL: pre-BUY + 4 -2 = -1 + 4 -2= 1, it's has lower profit than previous,
    //                  so, we won't sell, the max sell profit is 5.
    //    Day Six
    //        9 - BUY : pre-SELL - 9 = 5-9= -4, so won't buy, the max buy profit is 1.
    //            SELL: pre-BUY + 9 -2 = 1 + 9 -2 = 8, it's has higher profit. so we sell
    //
    //   Let's use an table
    //
    //            prices =   1,  3,  2,  8,  4,  9
    //    max buy profit =  -1, -1, -1, -1,  1,  5
    //   max sell profit =   0,  0,  0,  5,  5,  8
    //
    //   We can see we keep tracking the max buy and sell profit for everyday.
    //
    //       buy[i] = max( buy[i-1],                // do nothing
    //                     sell[i-1] - prices[i] ); // sell in previous day can buy today
    //
    //       sell[i] = max( sell[i-1],                    // do nothing
    //                      buy[i-1] + prices[i] - fee ); // sell today
    //
    int maxProfit_dp03(vector<int> &prices, int &fee) {
        int buy=-prices[0], sell=0;
        int pre_buy=0, pre_sell=0;

        for(auto price: prices) {
            pre_buy = buy;
            buy = max (sell - price, pre_buy);

            pre_sell = sell;
            sell = max( pre_buy + price - fee, pre_sell);
        }

        return sell;
    }
};


================================================
FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp
================================================
// Source : https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
// Author : Hao Chen
// Date   : 2014-06-18

/***************************************************************************************************** 
 *
 * Say you have an array for which the ith element is the price of a given stock on day i.
 * 
 * Design an algorithm to find the maximum profit. You may complete as many transactions as you like 
 * (i.e., buy one and sell one share of the stock multiple times).
 * 
 * Note: You may not engage in multiple transactions at the same time (i.e., you must sell the stock 
 * before you buy again).
 * 
 * Example 1:
 * 
 * Input: [7,1,5,3,6,4]
 * Output: 7
 * Explanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4.
 *              Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3.
 * 
 * Example 2:
 * 
 * Input: [1,2,3,4,5]
 * Output: 4
 * Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
 *              Note that you cannot buy on day 1, buy on day 2 and sell them later, as you are
 *              engaging multiple transactions at the same time. You must sell before buying again.
 * 
 * Example 3:
 * 
 * Input: [7,6,4,3,1]
 * Output: 0
 * Explanation: In this case, no transaction is done, i.e. max profit = 0.
 ******************************************************************************************************/

class Solution {
public:
    int maxProfit(vector<int>& prices) {
        return maxProfit02(prices);
        return maxProfit01(prices);
    }
    // Solution 1 
    // find all of ranges: which start a valley with the nearest peak after
    // add their delta together 
    //
    int maxProfit01(vector<int> &prices) {

        int max = 0;
        int low = -1;
	int len = prices.size();
        for (int i=0; i < len - 1; i++){
            //meet the valley, then goes up
            if (prices[i] < prices[i+1] && low < 0 ) {
                low = i;
            }
            //meet the peak, then goes down
            if (prices[i] > prices[i+1] && low >= 0) {
                max += ( prices[i] - prices[low] ) ;
                low = -1; // reset the `low`
            }
        }

        // edge case
        if ( low >= 0 ) {
            max += ( prices[prices.size()-1] - prices[low] );
        }

        return max;
    }

    // Solution 2 
    // if we find we can earn money, we just sell
    int maxProfit02(vector<int>& prices) {
        int profit = 0 ;
        for(int i=1; i< prices.size(); i++) {
            profit += max(0, prices[i] - prices[i-1]);
        }
        return profit;
    }
};


================================================
FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp
================================================
// Source : https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/
// Author : Hao Chen
// Date   : 2014-08-22

/***************************************************************************************************** 
 *
 * Say you have an array for which the ith element is the price of a given stock on day i.
 * 
 * Design an algorithm to find the maximum profit. You may complete at most two transactions.
 * 
 * Note: You may not engage in multiple transactions at the same time (i.e., you must sell the stock 
 * before you buy again).
 * 
 * Example 1:
 * 
 * Input: [3,3,5,0,0,3,1,4]
 * Output: 6
 * Explanation: Buy on day 4 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.
 *              Then buy on day 7 (price = 1) and sell on day 8 (price = 4), profit = 4-1 = 3.
 * 
 * Example 2:
 * 
 * Input: [1,2,3,4,5]
 * Output: 4
 * Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
 *              Note that you cannot buy on day 1, buy on day 2 and sell them later, as you are
 *              engaging multiple transactions at the same time. You must sell before buying again.
 * 
 * Example 3:
 * 
 * Input: [7,6,4,3,1]
 * Output: 0
 * Explanation: In this case, no transaction is done, i.e. max profit = 0.
 ******************************************************************************************************/


class Solution {
public:
    // Dynamic Programming
    //
    //     Considering prices[n], and we have a position "i", we could have
    //       1) the maxProfit1 for prices[0..i]  
    //       2) the maxProfit2 for proices[i..n]
    //
    //    So, 
    //      for 1) we can go through the prices[n] forwardly.
    //          forward[i] = max( forward[i-1], price[i] - lowestPrice[0..i] ) 
    //      for 2) we can go through the prices[n] backwoardly.
    //          backward[i] = max( backward[i+1], highestPrice[i..n] - price[i]) 
    //
    int maxProfit(vector<int> &prices) {
        if (prices.size()<=1) return 0;
        
        int n = prices.size();
        
        vector<int> forward(n);
        forward[0] = 0;
        int lowestBuyInPrice = prices[0];
        for(int i=1; i<n; i++){
            forward[i] = max(forward[i-1], prices[i] - lowestBuyInPrice);
            lowestBuyInPrice = min(lowestBuyInPrice, prices[i]);
        }
        
        vector<int> backward(n);
        backward[n-1] = 0;
        int highestSellOutPrice = prices[n-1];
        for(int i=n-2; i>=0; i--){
            backward[i] = max(backward[i+1], highestSellOutPrice - prices[i]);
            highestSellOutPrice = max(highestSellOutPrice, prices[i]);
        }
        
        int max_profit = 0;
        for(int i=0; i<n; i++){
            max_profit = max(max_profit, forward[i]+backward[i]);
        }
        
        return max_profit;
    }
};


================================================
FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp
================================================
// Source : https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/
// Author : Hao Chen
// Date   : 2015-03-31

/***************************************************************************************************** 
 *
 * Say you have an array for which the ith element is the price of a given stock on day i.
 * 
 * Design an algorithm to find the maximum profit. You may complete at most k transactions.
 * 
 * Note:
 * You may not engage in multiple transactions at the same time (ie, you must sell the stock before 
 * you buy again).
 * 
 * Example 1:
 * 
 * Input: [2,4,1], k = 2
 * Output: 2
 * Explanation: Buy on day 1 (price = 2) and sell on day 2 (price = 4), profit = 4-2 = 2.
 * 
 * Example 2:
 * 
 * Input: [3,2,6,5,0,3], k = 2
 * Output: 7
 * Explanation: Buy on day 2 (price = 2) and sell on day 3 (price = 6), profit = 6-2 = 4.
 *              Then buy on day 5 (price = 0) and sell on day 6 (price = 3), profit = 3-0 = 3.
 ******************************************************************************************************/

class Solution {
    public:
        /*
         *  profits[trans, day]
         *  - `trans` represents the number of transactions we've done so far. ( 0 <= trans <= k )
         *  - `day` represents the number of days so far. ( 0 <= day <= prices.size() )
         *
         *  So, we have the initialization as below:
         *
         *  profits[0, day] = 0; // 0 <= day <= prices.size()
         *  profits[trans, 0] = 0; // 0 <= trans <= k
         *
         *  And the iteration logic as below:
         *
         *  profits[trans, day] = max (
         *                              profits[trans, day-1], // same times transactions, but one days before.
         *                              profits[trans-1, i-1] + (prices[day] - prices[i]) // for all of (0 <= i < day )
         *                                                                                // this means find max profit from
         *                                                                                // previous any of days
         *                            )
         *
         */

        int maxProfit(int k, vector<int> &prices) {
            int ndays = prices.size();

            // error case
            if (ndays<=1) return 0;

            // Edge case
            // ---------
            // if the number of transactions is too many, it means we can make
            // as many transactions as we can, that brings us the problem back to
            // Best-Time-To-Buy-And-Sell-Stock-II which can be simply solve in O(n)
            // by using a greedy approach.
            if(k > ndays/2){
                int sum = 0;
                for (int i=1; i<ndays; i++) {
                    sum += max(prices[i] - prices[i-1], 0);
                }
                return sum;
            }

            return maxProfit_DP03(k, prices);//8ms
            return maxProfit_DP02(k, prices);//8ms
            return maxProfit_DP01(k, prices);//492ms
        }


        //DP solution - O(kn^2) complexity
        int maxProfit_DP01 (int k, vector<int> &prices) {
            int ndays = prices.size();
            vector< vector<int> > profits(k+1, vector<int>( ndays+1, 0));
            for(int trans=1; trans<=k; trans++) {
                for (int day=1; day<=ndays; day++) {
                    int m=0;
                    for (int i=1; i<=day; i++) {
                        m = max(m, profits[trans-1][i-1]+ prices[day-1] - prices[i-1]);
                    }
                    profits[trans][day] =  max( profits[trans][day-1], m);
                }
            }
            return profits[k][ndays];
        }

        //DP solution - O(kn) complexity
        //Actually, we could save the loop in above- for(int i=1; i<=day; i++)
        //Becasue there are so many dupliations

        int maxProfit_DP02 (int k, vector<int> &prices) {

            int ndays = prices.size();

            vector< vector<int> > profits(k+1, vector<int>( ndays+1, 0));
            vector<int> m(ndays+1, 0); // tracking the max profits of previous days

            for(int trans=1; trans<=k; trans++) {
                m[0] = profits[trans-1][0] - prices[0];
                for (int day=1; day<=ndays; day++) {
                    profits[trans][day] =  max( profits[trans][day-1], m[day-1]+prices[day-1]);
                    if (day < ndays) {
                        m[day] = max(m[day-1], profits[trans-1][day] - prices[day]);
                    }
                }
            }
            return profits[k][ndays];
        }


        // save the memory, remove the m[ ] array
        int maxProfit_DP03 (int k, vector<int> &prices) {
            int ndays = prices.size();
            vector< vector<int> > profits(k+1, vector<int>( ndays+1, 0));

            for(int trans=1; trans<=k; trans++) {
                int m = profits[trans-1][0] - prices[0];
                for (int day=1; day <= ndays; day++) {
                    profits[trans][day] = max(profits[trans][day-1], m + prices[day-1]);
                    if ( day < ndays ) {
                        m = max(m, profits[trans-1][day] - prices[day]);
                    }
                }
            }

            return profits[k][ndays];
        }
};


================================================
FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp
================================================
// Source : https://oj.leetcode.com/problems/best-time-to-buy-and-sell-sto
Download .txt
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
Download .txt
Showing preview only (224K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2441 symbols across 711 files)

FILE: algorithms/cpp/3Sum/3Sum.cpp
  function threeSum (line 48) | vector<vector<int> > threeSum(vector<int> &num) {
  function threeSum2 (line 99) | vector<vector<int> > threeSum2(vector<int> &num) {
  function isSumZero (line 110) | bool isSumZero(vector < int>& v) {
  function sum (line 114) | int sum(vector<int>& v) {
  function combination (line 122) | vector<vector<int> > combination(vector<int> &v, int k) {
  function printMatrix (line 168) | void printMatrix(vector<vector<int> > &matrix)
  function main (line 181) | int main()

FILE: algorithms/cpp/3SumClosest/3SumClosest.cpp
  function threeSumClosest (line 47) | int threeSumClosest(vector<int> &num, int target) {
  function main (line 97) | int main()

FILE: algorithms/cpp/4Sum/4Sum.cpp
  function fourSum (line 38) | vector<vector<int> > fourSum(vector<int> &num, int target) {
  function threeSum (line 57) | vector<vector<int> > threeSum(vector<int> num, int target) {
  function printMatrix (line 102) | int printMatrix(vector< vector<int> > &vv)
  function main (line 114) | int main()

FILE: algorithms/cpp/FindValidMatrixGivenRowAndColumnSums/FindValidMatrixGivenRowAndColumnSums.cpp
  class Solution (line 48) | class Solution {
    method restoreMatrix (line 50) | vector<vector<int>> restoreMatrix(vector<int>& row, vector<int>& col) {

FILE: algorithms/cpp/LRUCache/LRUCache.cpp
  class Node (line 32) | class Node {
    method Node (line 37) | Node(int k, int v) { key=k; value=v; next = prev = NULL; }
  class DoubleLinkedList (line 42) | class DoubleLinkedList {
    method DoubleLinkedList (line 52) | DoubleLinkedList(){
    method Size (line 64) | int Size() const {
    method Node (line 68) | Node* NewAtBegin(int key, int value) {
    method Node (line 73) | Node* NewAtEnd(int key, int value) {
    method Node (line 78) | Node* AddAtBegin(Node* n){
    method Node (line 93) | Node* AddAtEnd(Node* n) {
    method Unlink (line 107) | void Unlink(Node* n){
    method Delete (line 128) | void Delete(Node* n){
    method TakeToBegin (line 133) | void TakeToBegin(Node* n){
    method Node (line 138) | Node* GetTailNode() {
    method DeleteLast (line 142) | void DeleteLast() {
    method Print (line 146) | void Print(){
  class LRUCache (line 158) | class LRUCache{
    method LRUCache (line 169) | LRUCache(int capacity) {
    method print (line 172) | void print(){
    method get (line 176) | int get(int key) {
    method set (line 186) | void set(int key, int value) {
  function main (line 206) | int main(int argc, char** argv)

FILE: algorithms/cpp/NumberOfWaysToSplitString/NumberOfWaysToSplitString.cpp
  class Solution (line 49) | class Solution {
    method numWays (line 51) | int numWays(string s) {

FILE: algorithms/cpp/UTF8Validation/UTF8Validation.cpp
  class Solution (line 49) | class Solution {
    method validUtf8 (line 51) | bool validUtf8(vector<int>& data) {

FILE: algorithms/cpp/accountsMerge/AccountsMerge.cpp
  class Solution_Time_Limit_Exceeded (line 45) | class Solution_Time_Limit_Exceeded {
    method accountsMerge (line 50) | vector<vector<string>> accountsMerge(vector<vector<string>>& accounts) {
    method string (line 85) | string find(unordered_map<string, string>& emails_chains,
    method join (line 93) | bool join(unordered_map<string, string>& emails_chains,
  class Solution (line 112) | class Solution {
    method accountsMerge (line 117) | vector<vector<string>> accountsMerge(vector<vector<string>>& accounts) {
    method find (line 161) | int find(unordered_map<int, int>& emails_chains, int id) {
    method join (line 168) | bool join(unordered_map<int, int>& emails_chains, int id1, int id2) {

FILE: algorithms/cpp/addAndSearchWord/AddAndSearchWord.cpp
  class TrieNode (line 42) | class TrieNode {
    method TrieNode (line 44) | TrieNode():isWord(false) {
    method TrieNode (line 47) | TrieNode* & operator [] (char idx){
    method TrieNode (line 51) | TrieNode* & operator [] (int idx){
  class TrieTree (line 62) | class TrieTree {
    method TrieTree (line 64) | TrieTree():root(new TrieNode()){ }
    method put (line 67) | void put(string &s) {
    method search (line 77) | bool search(string &s){
    method get (line 83) | bool get(string &s, TrieNode* root, int idx=0){
    method freeTree (line 114) | void freeTree(TrieNode* root){
  class WordDictionary (line 125) | class WordDictionary {
    method addWord (line 129) | void addWord(string word) {
    method search (line 135) | bool search(string word) {
  function main (line 147) | int main()

FILE: algorithms/cpp/addBinary/addBinary.cpp
  function string (line 21) | string addBinary(string a, string b) {
  function main (line 41) | int main(int argc, char** argv)

FILE: algorithms/cpp/addDigits/addDigits.cpp
  class Solution (line 16) | class Solution {
    method addDigits (line 19) | int addDigits(int num) {
    method addDigits01 (line 31) | int addDigits01(int num) {
    method addDigits02 (line 43) | int addDigits02(int num) {
    method addDigits03 (line 74) | int addDigits03(int num) {
    method addDigits04 (line 79) | int addDigits04(int num){
    method addDigits05 (line 84) | int addDigits05(int num){

FILE: algorithms/cpp/addStrings/AddStrings.cpp
  class Solution (line 19) | class Solution {
    method string (line 21) | string addStrings(string num1, string num2) {

FILE: algorithms/cpp/addToArrayFormOfInteger/AddToArrayFormOfInteger.cpp
  class Solution (line 45) | class Solution {
    method addToArrayForm (line 47) | vector<int> addToArrayForm(vector<int>& A, int K) {

FILE: algorithms/cpp/addTwoNumbers/addTwoNumbers.cpp
  class Solution (line 24) | class Solution {
    method ListNode (line 27) | ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) {
    method getValueAndMoveNext (line 52) | int getValueAndMoveNext(ListNode* &l){

FILE: algorithms/cpp/additiveNumber/AdditiveNumber.cpp
  class Solution (line 35) | class Solution {
    method isAdditiveNumber (line 37) | bool isAdditiveNumber(string num) {
    method isAdditiveNumberHelper (line 54) | bool isAdditiveNumberHelper(string& n1, string& n2, string& n3){
    method string (line 71) | string StringAdd(string n1, string n2) {

FILE: algorithms/cpp/anagrams/GroupAnagrams.cpp
  class Solution (line 30) | class Solution {
    method groupAnagrams (line 32) | vector< vector<string> > groupAnagrams(vector<string> &strs) {
    method groupAnagrams01 (line 56) | vector< vector<string> > groupAnagrams01(vector<string> &strs) {
    method anagrams (line 74) | vector<string> anagrams(vector<string> &strs) {

FILE: algorithms/cpp/anagrams/ValidAnagram.cpp
  class Solution (line 19) | class Solution {
    method isAnagram01 (line 23) | bool isAnagram01(string s, string t) {
    method isAnagram02 (line 30) | bool isAnagram02(string s, string t) {
    method isAnagram (line 52) | bool isAnagram(string s, string t) {

FILE: algorithms/cpp/arithmeticSlices/ArithmeticSlices.cpp
  class Solution (line 34) | class Solution {
    method sum1toN (line 55) | int sum1toN(int n) {
    method numberOfArithmeticSlices (line 59) | int numberOfArithmeticSlices(vector<int>& A) {

FILE: algorithms/cpp/backspaceStringCompare/BackspaceStringCompare.cpp
  class Solution (line 64) | class Solution {
    method removeBackspaces (line 66) | void removeBackspaces(string &s) {
    method backspaceCompare (line 78) | bool backspaceCompare(string S, string T) {

FILE: algorithms/cpp/balancedBinaryTree/balancedBinaryTree.cpp
  class Solution (line 24) | class Solution {
    method isBalanced (line 26) | bool isBalanced(TreeNode *root) {
    method isBalancedUtil (line 31) | bool isBalancedUtil(TreeNode* root, int& height){
    method isBalanced (line 50) | bool isBalanced(TreeNode *root) {
    method treeDepth (line 62) | int treeDepth(TreeNode *root) {
  class Solution (line 48) | class Solution {
    method isBalanced (line 26) | bool isBalanced(TreeNode *root) {
    method isBalancedUtil (line 31) | bool isBalancedUtil(TreeNode* root, int& height){
    method isBalanced (line 50) | bool isBalanced(TreeNode *root) {
    method treeDepth (line 62) | int treeDepth(TreeNode *root) {

FILE: algorithms/cpp/basicCalculator/BasicCalculator.II.cpp
  function isOperator (line 37) | bool isOperator(const char ch) {
  function Priority (line 42) | int Priority(const char c) {
  function calculate_exp (line 52) | long long calculate_exp(long long x, long long y, char op) {
  function calculate_two_stacks (line 64) | int calculate_two_stacks(string& s) {
  function calculate (line 108) | int calculate(string s) {
  function main (line 112) | int main(int argc, char**argv)

FILE: algorithms/cpp/basicCalculator/BasicCalculator.cpp
  class Expression (line 41) | class Expression
  class Number (line 48) | class Number: public Expression
    method Number (line 52) | Number(string num) { this->number = atoi(num.c_str()); }
    method interpret (line 54) | int interpret() { return number; }
  class Plus (line 59) | class Plus : public Expression
    method Plus (line 62) | Plus(Expression* left, Expression* right) :leftOperand(left), rightOpe...
    method interpret (line 64) | int interpret() { return leftOperand->interpret() + rightOperand->inte...
  class Minus (line 70) | class Minus : public Expression
    method Minus (line 73) | Minus(Expression* left, Expression* right) :leftOperand(left), rightOp...
    method interpret (line 75) | int interpret() { return leftOperand->interpret() - rightOperand->inte...
  class Multiply (line 81) | class Multiply : public Expression
    method Multiply (line 84) | Multiply(Expression* left, Expression* right) :leftOperand(left), righ...
    method interpret (line 86) | int interpret() { return leftOperand->interpret() * rightOperand->inte...
  class Divide (line 92) | class Divide : public Expression
    method Divide (line 95) | Divide(Expression* left, Expression* right) :leftOperand(left), rightO...
    method interpret (line 97) | int interpret() { return leftOperand->interpret() / rightOperand->inte...
  function isOperator (line 103) | bool isOperator(const string &c) {
  function isOperator (line 106) | bool isOperator(const char &c) {
  class Evaluator (line 110) | class Evaluator : public Expression
    method Evaluator (line 116) | Evaluator(vector<string>& s)
    method interpret (line 144) | int interpret() {
  function Parse (line 152) | vector<string> Parse(string& s){
  function Priority (line 175) | int Priority(const string &c) {
  function Infix2RPN (line 185) | vector<string> Infix2RPN(vector<string>& infix) {
  function calculate_RPN_design_pattern (line 218) | int calculate_RPN_design_pattern(string& s) {
  function calculate_RPN_evluation (line 240) | int calculate_RPN_evluation(string& s) {
  function calculate_two_stacks (line 262) | inline void calculate_two_stacks(stack<int>& num_stack, stack<char>& op_...
  function calculate_two_stacks (line 269) | int calculate_two_stacks(string& s) {
  function calculate (line 298) | int calculate(string s) {
  function main (line 304) | int main(int argc, char** argv) {

FILE: algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithCooldown.cpp
  class Solution (line 22) | class Solution {
    method maxProfit (line 41) | int maxProfit(vector<int>& prices) {

FILE: algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithTransactionFee.cpp
  class Solution (line 33) | class Solution {
    method max (line 35) | int max(int x, int y) {
    method max (line 38) | int max(int x, int y, int z) {
    method maxProfit (line 44) | int maxProfit(vector<int>& prices, int fee) {
    method genPricesPairs (line 52) | void genPricesPairs(vector<int> &prices, vector< pair<int, int> > &pri...
    method maxProfit_dp01 (line 74) | int maxProfit_dp01(vector<int> &prices, int &fee) {
    method maxProfit_dp02 (line 93) | int maxProfit_dp02(vector<int> &prices, int &fee) {
    method maxProfit_dp03 (line 187) | int maxProfit_dp03(vector<int> &prices, int &fee) {

FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp
  class Solution (line 37) | class Solution {
    method maxProfit (line 39) | int maxProfit(vector<int>& prices) {
    method maxProfit01 (line 47) | int maxProfit01(vector<int> &prices) {
    method maxProfit02 (line 74) | int maxProfit02(vector<int>& prices) {

FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp
  class Solution (line 37) | class Solution {
    method maxProfit (line 51) | int maxProfit(vector<int> &prices) {

FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp
  class Solution (line 29) | class Solution {
    method maxProfit (line 52) | int maxProfit(int k, vector<int> &prices) {
    method maxProfit_DP01 (line 79) | int maxProfit_DP01 (int k, vector<int> &prices) {
    method maxProfit_DP02 (line 98) | int maxProfit_DP02 (int k, vector<int> &prices) {
    method maxProfit_DP03 (line 119) | int maxProfit_DP03 (int k, vector<int> &prices) {

FILE: algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp
  class Solution (line 29) | class Solution {
    method maxProfit (line 44) | int maxProfit(vector<int> &prices) {
    method maxProfit (line 72) | int maxProfit(vector<int>& prices) {
  class Solution (line 70) | class Solution {
    method maxProfit (line 44) | int maxProfit(vector<int> &prices) {
    method maxProfit (line 72) | int maxProfit(vector<int>& prices) {

FILE: algorithms/cpp/binarySearchTreeIterator/binarySearchTreeIterator.cpp
  class BSTIterator (line 17) | class BSTIterator {
    method BSTIterator (line 23) | BSTIterator(TreeNode *root) {
    method hasNext (line 40) | bool hasNext() {
    method next (line 45) | int next() {

FILE: algorithms/cpp/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp
  class Solution (line 53) | class Solution {
    method inorderTraversal (line 55) | vector<int> inorderTraversal(TreeNode *root) {

FILE: algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp
  class Solution (line 58) | class Solution {
    method levelOrderBottom (line 60) | vector<vector<int> > levelOrderBottom(TreeNode *root) {

FILE: algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp
  type TreeNode (line 59) | struct TreeNode {
    method TreeNode (line 63) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function levelOrder (line 71) | vector<vector<int> > levelOrder(TreeNode *root) {
  function levelOrder1 (line 81) | vector<vector<int> > levelOrder1(TreeNode *root) {
  function levelOrder2 (line 125) | vector<vector<int> > levelOrder2(TreeNode *root) {
  function levelOrder3 (line 156) | vector<vector<int> > levelOrder3(TreeNode *root) {
  function printTree (line 185) | void printTree(TreeNode *root)
  function printTree_level_order (line 197) | void printTree_level_order(TreeNode *root)
  function TreeNode (line 215) | TreeNode* createTree(int a[], int n)
    method TreeNode (line 63) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function printMatrix (line 240) | int printMatrix(vector< vector<int> > &vv)
  function main (line 251) | int main()

FILE: algorithms/cpp/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp
  type TreeNode (line 28) | struct TreeNode {
    method TreeNode (line 32) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function maxPathSum (line 36) | int maxPathSum(TreeNode *root, int& maxSum ) {
  function maxPathSum (line 60) | int maxPathSum(TreeNode *root) {
  function main (line 67) | int main()

FILE: algorithms/cpp/binaryTreePaths/binaryTreePaths.cpp
  class Solution (line 34) | class Solution {
    method DFS (line 37) | void DFS(TreeNode* node, string answer)
    method binaryTreePaths (line 50) | vector<string> binaryTreePaths(TreeNode* root) {
    method binaryTreePathsHelper (line 68) | void binaryTreePathsHelper(TreeNode* root, vector<int> solution, vecto...
    method binaryTreePaths (line 89) | vector<string> binaryTreePaths(TreeNode* root) {
  class Solution (line 66) | class Solution {
    method DFS (line 37) | void DFS(TreeNode* node, string answer)
    method binaryTreePaths (line 50) | vector<string> binaryTreePaths(TreeNode* root) {
    method binaryTreePathsHelper (line 68) | void binaryTreePathsHelper(TreeNode* root, vector<int> solution, vecto...
    method binaryTreePaths (line 89) | vector<string> binaryTreePaths(TreeNode* root) {

FILE: algorithms/cpp/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp
  type TreeNode (line 32) | struct TreeNode {
    method TreeNode (line 36) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function postorderTraversal (line 47) | vector<int> postorderTraversal(TreeNode *root) {
  function postorderTraversal1 (line 57) | vector<int> postorderTraversal1(TreeNode *root) {
  function postorderTraversal2 (line 80) | vector<int> postorderTraversal2(TreeNode *root) {
  function TreeNode (line 108) | TreeNode* createTree(int a[], int n)
    method TreeNode (line 36) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function printTree_post_order (line 133) | void printTree_post_order(TreeNode *root)
  function printArray (line 145) | void printArray(vector<int> v)
  function main (line 153) | int main()

FILE: algorithms/cpp/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp
  type TreeNode (line 31) | struct TreeNode {
    method TreeNode (line 35) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function preorderTraversal (line 41) | vector<int> preorderTraversal(TreeNode *root) {
  function preorderTraversal1 (line 50) | vector<int> preorderTraversal1(TreeNode *root) {
  function preorderTraversal2 (line 70) | vector<int> preorderTraversal2(TreeNode *root) {
  function TreeNode (line 91) | TreeNode* createTree(int a[], int n)
    method TreeNode (line 35) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function printTree_pre_order (line 116) | void printTree_pre_order(TreeNode *root)
  function printArray (line 128) | void printArray(vector<int> v)
  function main (line 136) | int main()

FILE: algorithms/cpp/binaryTreeRightSideView/binaryTreeRightSideView.cpp
  class Solution (line 34) | class Solution {
    method rightSideViewHelper (line 36) | void rightSideViewHelper(TreeNode* root, int level, vector<int>& resul...
    method rightSideViewHelper (line 43) | void rightSideViewHelper(TreeNode* root, vector<int>& result) {
    method rightSideView (line 67) | vector<int> rightSideView(TreeNode *root) {

FILE: algorithms/cpp/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp
  class Solution (line 39) | class Solution {
    method TreeNode (line 41) | TreeNode *upsideDownBinaryTree(TreeNode *root) {

FILE: algorithms/cpp/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp
  type TreeNode (line 57) | struct TreeNode {
    method TreeNode (line 61) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function zigzagLevelOrder (line 66) | vector<vector<int> > zigzagLevelOrder(TreeNode *root) {
  function zigzagLevelOrder1 (line 73) | vector<vector<int> > zigzagLevelOrder1(TreeNode *root) {
  function TreeToArray_level_order (line 109) | vector<TreeNode*> TreeToArray_level_order(TreeNode* root){
  function zigzagLevelOrder2 (line 130) | vector<vector<int> > zigzagLevelOrder2(TreeNode *root) {
  function printTree_level_order (line 159) | void printTree_level_order(TreeNode *root)
  function TreeNode (line 177) | TreeNode* createTree(int a[], int n)
    method TreeNode (line 61) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function printMatrix (line 202) | int printMatrix(vector< vector<int> > &vv)
  function main (line 214) | int main(int argc, char** argv)

FILE: algorithms/cpp/binaryWatch/BinaryWatch.cpp
  class Solution (line 29) | class Solution {
    method combination (line 31) | void combination(int nLED, int nLight, int max, bool zero,
    method generate_combination (line 54) | void generate_combination(int nLED, int max, bool zero, vector<vector<...
    method print (line 60) | void print(vector<vector<string>>&  vv) {
    method Solution (line 76) | Solution():hour(4, vector<string>()), mins(6, vector<string>()){
    method readBinaryWatch (line 95) | vector<string> readBinaryWatch(int num) {

FILE: algorithms/cpp/bitwiseANDOfNumbersRange/BitwiseAndOfNumbersRange.cpp
  function rangeBitwiseAnd (line 41) | int rangeBitwiseAnd(int m, int n) {
  function main (line 56) | int main(int argc, char**argv) {

FILE: algorithms/cpp/brokenCalculator/BrokenCalculator.cpp
  class Solution (line 47) | class Solution {
    method brokenCalc (line 49) | int brokenCalc(int X, int Y) {

FILE: algorithms/cpp/buddyStrings/BuddyStrings.cpp
  class Solution (line 69) | class Solution {
    method buddyStrings (line 71) | bool buddyStrings(string A, string B) {

FILE: algorithms/cpp/buildingBoxes/BuildingBoxes.cpp
  class Solution (line 85) | class Solution {
    method total (line 87) | int total(long h){
    method minimumBoxes (line 91) | int minimumBoxes(int n) {

FILE: algorithms/cpp/bulbSwitcher/BulbSwitcher.II.cpp
  class Solution (line 77) | class Solution {
    method flipLights (line 79) | int flipLights(int n, int m) {

FILE: algorithms/cpp/bulbSwitcher/BulbSwitcher.III.cpp
  class Solution (line 51) | class Solution {
    method numTimesAllBlue (line 53) | int numTimesAllBlue(vector<int>& light) {

FILE: algorithms/cpp/bulbSwitcher/BulbSwitcher.IV.cpp
  class Solution (line 54) | class Solution {
    method minFlips (line 56) | int minFlips(string target) {

FILE: algorithms/cpp/bulbSwitcher/bulbSwitcher.cpp
  class Solution (line 47) | class Solution {
    method bulbSwitch (line 49) | int bulbSwitch(int n) {
    method bulbSwitch (line 77) | int bulbSwitch(int n) {
  class Solution (line 75) | class Solution {
    method bulbSwitch (line 49) | int bulbSwitch(int n) {
    method bulbSwitch (line 77) | int bulbSwitch(int n) {

FILE: algorithms/cpp/bullsAndCows/bullsAndCows.cpp
  class Solution (line 37) | class Solution {
    method string (line 39) | string getHint(string secret, string guess) {
    method string (line 44) | string getHint01(string secret, string guess) {
    method string (line 64) | string getHint02(string secret, string guess) {

FILE: algorithms/cpp/burstBalloons/BurstBalloons.cpp
  class Solution (line 37) | class Solution {
    method maxCoins (line 39) | int maxCoins(vector<int>& nums) {
    method maxCoins_DC (line 66) | int maxCoins_DC(vector<int>& nums, vector<vector<int>>& matrix, int lo...
    method maxCoins_DP (line 83) | int maxCoins_DP(vector<int>& nums, vector<vector<int>>& dp) {
    method printVector (line 97) | void printVector(vector<int>& nums) {

FILE: algorithms/cpp/calculateMoneyInLeetcodeBank/CalculateMoneyInLeetcodeBank.cpp
  class Solution (line 41) | class Solution {
    method totalMoney (line 43) | int totalMoney(int n) {

FILE: algorithms/cpp/candy/candy.cpp
  function candy (line 54) | int candy(vector<int> &ratings) {
  function generateRatings (line 74) | void generateRatings(vector<int> &ratings, int n) {
  function print (line 81) | void print(vector<int> &v) {
  function main (line 88) | int main(int argc, char**argv)

FILE: algorithms/cpp/checkIfArrayIsSortedAndRotated/CheckIfArrayIsSortedAndRotated.cpp
  class Solution (line 55) | class Solution {
    method check (line 57) | bool check(vector<int>& nums) {

FILE: algorithms/cpp/checkIfBinaryStringHasAtMostOneSegmentOfOnes/CheckIfBinaryStringHasAtMostOneSegmentOfOnes.cpp
  class Solution (line 28) | class Solution {
    method checkOnesSegment (line 30) | bool checkOnesSegment(string s) {

FILE: algorithms/cpp/checkIfNumberIsASumOfPowersOfThree/CheckIfNumberIsASumOfPowersOfThree.cpp
  class Solution (line 34) | class Solution {
    method checkPowersOfThree (line 36) | bool checkPowersOfThree(int n) {
    method checkPowersOfThree_DFS (line 41) | bool checkPowersOfThree_DFS(int n, int p) {
    method checkPowersOfThree_Base3 (line 59) | bool checkPowersOfThree_Base3(int n) {

FILE: algorithms/cpp/checkIfOneStringSwapCanMakeStringsEqual/CheckIfOneStringSwapCanMakeStringsEqual.cpp
  class Solution (line 43) | class Solution {
    method areAlmostEqual (line 45) | bool areAlmostEqual(string s1, string s2) {

FILE: algorithms/cpp/checkIfTheSentenceIsPangram/CheckIfTheSentenceIsPangram.cpp
  class Solution (line 29) | class Solution {
    method checkIfPangram (line 31) | bool checkIfPangram(string sentence) {

FILE: algorithms/cpp/checkIfWordEqualsSummationOfTwoWords/CheckIfWordEqualsSummationOfTwoWords.cpp
  class Solution (line 59) | class Solution {
    method strToInt (line 61) | int strToInt(string& str) {
    method isSumEqual (line 68) | bool isSumEqual(string firstWord, string secondWord, string targetWord) {

FILE: algorithms/cpp/climbStairs/climbStairs.cpp
  class Solution (line 14) | class Solution {
    method climbStairs (line 17) | int climbStairs(int n) {
    method climbStairs2 (line 28) | int climbStairs2(int n) {

FILE: algorithms/cpp/cloneGraph/cloneGraph.cpp
  class Solution (line 43) | class Solution {
    method UndirectedGraphNode (line 45) | UndirectedGraphNode *cloneGraph(UndirectedGraphNode *node) {

FILE: algorithms/cpp/closestDessertCost/ClosestDessertCost.cpp
  class Solution (line 70) | class Solution {
    method abs_min (line 72) | int abs_min (int x, int y, int z) {
    method abs_min (line 77) | int abs_min(int x, int y) {
    method closestCost (line 84) | int closestCost(vector<int>& baseCosts, vector<int>& toppingCosts, int...
    method closetToppingCost (line 95) | int closetToppingCost(vector<int>& costs, int target, int idx ){

FILE: algorithms/cpp/closestRoom/ClosestRoom.cpp
  class Solution (line 55) | class Solution {
    method print (line 57) | void print(vector<vector<int>>& vv) {
    method closestRoom (line 66) | vector<int> closestRoom(vector<vector<int>>& rooms, vector<vector<int>...

FILE: algorithms/cpp/closestSubsequenceSum/ClosestSubsequenceSum.cpp
  class Solution (line 44) | class Solution {
    method abs (line 46) | int abs(int n){
    method printSet (line 50) | void printSet(set<int>& s){
    method findClosetDiff (line 58) | int findClosetDiff(set<int>& sums, int goal) {
    method getAllSums (line 71) | void getAllSums(int index, int end, vector<int>& nums, int sum, set<in...
    method getAllSums (line 80) | void getAllSums(int start, int end, vector<int>& nums, set<int>& sums) {
    method minAbsDifference (line 91) | int minAbsDifference(vector<int>& nums, int goal) {

FILE: algorithms/cpp/coinChange/CoinChange2.cpp
  class Solution (line 42) | class Solution {
    method change (line 44) | int change(int amount, vector<int>& coins) {
    method change_recursive (line 50) | int change_recursive(int amount, vector<int>& coins) {
    method change_recursive_helper (line 57) | void change_recursive_helper(int amount, vector<int>& coins, int idx, ...
    method change_dp (line 70) | int change_dp(int amount, vector<int>& coins) {

FILE: algorithms/cpp/coinChange/coinChange.cpp
  function Solution (line 31) | class Solution {
    method coinChange (line 88) | int coinChange(vector<int>& coins, int amount) {
  class Solution (line 86) | class Solution {
    method coinChange (line 88) | int coinChange(vector<int>& coins, int amount) {

FILE: algorithms/cpp/combinationSum/combinationSum.II.cpp
  function combinationSumHelper (line 35) | void combinationSumHelper(vector<int> &candidates, int start, int target...
  function combinationSum2 (line 55) | vector<vector<int> > combinationSum2(vector<int> &candidates, int target) {
  function printMatrix (line 68) | void printMatrix(vector< vector<int> > &vv)
  function printArray (line 79) | void printArray(vector<int> &v)
  function test (line 88) | void test(int a[], int len, int target)
  function main (line 99) | int main(int argc, char** argv)

FILE: algorithms/cpp/combinationSum/combinationSum.III.cpp
  function combinationSumHelper (line 31) | void combinationSumHelper(vector<int>& candidates, int start, int num, i...
  function combinationSum3 (line 48) | vector< vector<int> > combinationSum3(int k, int n) {
  function PrintResults (line 63) | void PrintResults(int k, int n, vector< vector<int> >& results) {
  function main (line 75) | int main(int argc, char** argv)

FILE: algorithms/cpp/combinationSum/combinationSum.cpp
  function combinationSumHelper (line 32) | void combinationSumHelper(vector<int> &candidates, int start, int target...
  function combinationSum (line 51) | vector<vector<int> > combinationSum(vector<int> &candidates, int target) {
  function printMatrix (line 64) | void printMatrix(vector< vector<int> > &vv)
  function printArray (line 75) | void printArray(vector<int> &v)
  function main (line 85) | int main(int argc, char** argv)

FILE: algorithms/cpp/combinationSumIV/combinationSumIV.cpp
  class Solution (line 52) | class Solution {
    method combinationSum4 (line 54) | int combinationSum4(vector<int>& nums, int target) {

FILE: algorithms/cpp/combinations/combinations.cpp
  function combine (line 36) | vector<vector<int> > combine(int n, int k) {
  function combine1 (line 45) | vector<vector<int> > combine1(int n, int k) {
  function getCombination (line 52) | void getCombination(int n, int k, vector<int>& solution, vector< vector<...
  function combine2 (line 67) | vector<vector<int> > combine2(int n, int k) {
  function printResult (line 114) | void printResult(vector<vector<int> >& result)
  function main (line 125) | int main(int argc, char** argv)

FILE: algorithms/cpp/compareStringsByFrequencyOfTheSmallestCharacter/CompareStringsByFrequencyOfTheSmallestCharacter.cpp
  class Solution (line 35) | class Solution {
    method numSmallerByFrequency (line 37) | vector<int> numSmallerByFrequency(vector<string>& queries, vector<stri...
    method f (line 52) | int f(string& s) {
    method binary_search (line 66) | int binary_search(vector<int> &v, int target) {

FILE: algorithms/cpp/compareVersionNumbers/compareVersionNumbers.cpp
  class Solution (line 21) | class Solution {
    method split (line 33) | vector<int> split(const string &s, char delim) {
    method rightTrimZero (line 39) | void rightTrimZero(vector<int> &v){
    method compareVersion (line 45) | int compareVersion(string version1, string version2) {

FILE: algorithms/cpp/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp
  type TreeNode (line 20) | struct TreeNode {
    method TreeNode (line 24) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function TreeNode (line 29) | TreeNode *buildTree(vector<int> &inorder, vector<int> &postorder) {
    method TreeNode (line 24) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function TreeNode (line 34) | TreeNode *buildTree(vector<int> &inorder, int in_offset, vector<int> &po...
    method TreeNode (line 24) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function TreeNode (line 63) | TreeNode *buildTree2(vector<int> &inorder, vector<int> &postorder) {
    method TreeNode (line 24) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function printTree_pre_order (line 102) | void printTree_pre_order(TreeNode *root)
  function printTree_in_order (line 114) | void printTree_in_order(TreeNode *root)
  function printTree_level_order (line 127) | void printTree_level_order(TreeNode *root)
  function main (line 146) | int main()

FILE: algorithms/cpp/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp
  type TreeNode (line 20) | struct TreeNode {
    method TreeNode (line 24) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function TreeNode (line 29) | TreeNode *buildTree(vector<int> &preorder, vector<int> &inorder) {
    method TreeNode (line 24) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function TreeNode (line 34) | TreeNode *buildTree(vector<int>& preorder, int& preidx, vector<int>& ino...
    method TreeNode (line 24) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function printTree_pre_order (line 74) | void printTree_pre_order(TreeNode *root)
  function printTree_in_order (line 86) | void printTree_in_order(TreeNode *root)
  function printTree_level_order (line 99) | void printTree_level_order(TreeNode *root)
  function main (line 118) | int main()

FILE: algorithms/cpp/constructTheLexicographicallyLargestValidSequence/ConstructTheLexicographicallyLargestValidSequence.cpp
  class Solution (line 42) | class Solution {
    method print (line 44) | void print(vector<int>& v) {
    method constructDistancedSequence (line 52) | vector<int> constructDistancedSequence(int n) {
    method dfs (line 62) | bool dfs(vector<bool>& available, vector<int>& result, int pos, int cnt){

FILE: algorithms/cpp/containerWithMostWater/containerWithMostWater.cpp
  class Solution (line 17) | class Solution {
    method maxArea (line 19) | int maxArea(vector<int> &height) {

FILE: algorithms/cpp/containsDuplicate/ContainsDuplicate.II.cpp
  class Solution (line 14) | class Solution {
    method containsNearbyDuplicate (line 16) | bool containsNearbyDuplicate(vector<int>& nums, int k) {

FILE: algorithms/cpp/containsDuplicate/ContainsDuplicate.III.cpp
  class Solution (line 15) | class Solution {
    method containsNearbyAlmostDuplicate (line 17) | bool containsNearbyAlmostDuplicate(vector<int>& nums, int k, int t) {

FILE: algorithms/cpp/containsDuplicate/ContainsDuplicate.cpp
  class Solution (line 14) | class Solution {
    method containsDuplicate (line 16) | bool containsDuplicate(vector<int>& nums) {

FILE: algorithms/cpp/convertANumberToHexadecimal/ConvertANumberToHexadecimal.cpp
  class Solution (line 37) | class Solution {
    method string (line 40) | string toHex(int num) {

FILE: algorithms/cpp/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp
  class Solution (line 20) | class Solution {
    method TreeNode (line 22) | TreeNode *sortedArrayToBST(vector<int> &num) {

FILE: algorithms/cpp/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp
  type ListNode (line 19) | struct ListNode {
    method ListNode (line 22) | ListNode(int x) : val(x), next(NULL) {}
  type TreeNode (line 26) | struct TreeNode {
    method TreeNode (line 30) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function TreeNode (line 36) | TreeNode *sortedListToBST(ListNode *head) {
    method TreeNode (line 30) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function TreeNode (line 45) | TreeNode* sortedListToBST(int low, int high, ListNode*& head) {
    method TreeNode (line 30) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function printTree_level_order (line 62) | void printTree_level_order(TreeNode *root)
  function ListNode (line 80) | ListNode* createList(int a[], int n)
    method ListNode (line 22) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 94) | void printList(ListNode* h)
  function main (line 104) | int main(int argc, char** argv)

FILE: algorithms/cpp/copyListWithRandomPointer/copyListWithRandomPointer.cpp
  class Solution (line 69) | class Solution {
    method RandomListNode (line 71) | RandomListNode *copyRandomList(RandomListNode *head) {
  class MySolution (line 147) | class MySolution {
    method RandomListNode (line 149) | RandomListNode *copyRandomList(RandomListNode *head) {

FILE: algorithms/cpp/countAndSay/countAndSay.cpp
  function string (line 28) | string vecToStr(vector<int> v) {
  function getNext (line 36) | vector<int> getNext(vector<int>& v) {
  function string (line 63) | string countAndSay(int n) {
  function main (line 79) | int main(int argc, char** argv)

FILE: algorithms/cpp/countCompleteTreeNodes/CountCompleteTreeNodes.cpp
  class Solution (line 28) | class Solution {
    method isCompleteTree (line 31) | int isCompleteTree(TreeNode* root) {
    method countNodes (line 46) | int countNodes(TreeNode* root) {

FILE: algorithms/cpp/countGoodMeals/CountGoodMeals.cpp
  class Solution (line 38) | class Solution {
    method countPairs (line 40) | int countPairs(vector<int>& deliciousness) {

FILE: algorithms/cpp/countItemsMatchingARule/CountItemsMatchingARule.cpp
  class Solution (line 43) | class Solution {
    method countMatches (line 45) | int countMatches(vector<vector<string>>& items, string ruleKey, string...

FILE: algorithms/cpp/countNicePairsInAnArray/CountNicePairsInAnArray.cpp
  class Solution (line 36) | class Solution {
    method rev (line 38) | int rev(int n) {
    method countNicePairs (line 48) | int countNicePairs(vector<int>& nums) {
    method countNicePairs01 (line 52) | int countNicePairs01(vector<int>& nums) {
    method countNicePairs02 (line 72) | int countNicePairs02(vector<int>& nums) {

FILE: algorithms/cpp/countNumberOfHomogenousSubstrings/CountNumberOfHomogenousSubstrings.cpp
  class Solution (line 45) | class Solution {
    method countHomogenous (line 47) | int countHomogenous(string s) {

FILE: algorithms/cpp/countNumbersWithUniqueDigits/CountNumbersWithUniqueDigits.cpp
  class Solution (line 35) | class Solution {
    method countNumbersWithUniqueDigits (line 37) | int countNumbersWithUniqueDigits(int n) {
    method nine_factor (line 45) | int nine_factor(int n) {
    method countNumbersWithUniqueDigits (line 59) | int countNumbersWithUniqueDigits(int n) {
  class Solution (line 57) | class Solution {
    method countNumbersWithUniqueDigits (line 37) | int countNumbersWithUniqueDigits(int n) {
    method nine_factor (line 45) | int nine_factor(int n) {
    method countNumbersWithUniqueDigits (line 59) | int countNumbersWithUniqueDigits(int n) {

FILE: algorithms/cpp/countOddNumbersInAnIntervalRange/CountOddNumbersInAnIntervalRange.cpp
  class Solution (line 27) | class Solution {
    method countOdds1 (line 29) | int countOdds1(int low, int high) {
    method countOdds2 (line 35) | int countOdds2(int low, int high) {
    method countOdds (line 38) | int countOdds(int low, int high) {

FILE: algorithms/cpp/countOfRangeSum/CountOfRangeSum.cpp
  class Node (line 73) | class Node{
    method Node (line 78) | Node(long long v):val(v), cnt(1), left(NULL), right(NULL) {}
  class Tree (line 82) | class Tree{
    method Tree (line 84) | Tree():root(NULL){ }
    method Insert (line 87) | void Insert(long long val) {
    method LessThan (line 90) | int LessThan(long long sum, int val) {
    method Insert (line 98) | void Insert(Node* &root, long long val) {
    method LessThan (line 115) | int LessThan(Node* root, long long sum, int val, int res) {
    method freeTree (line 134) | void freeTree(Node* root){
  class Solution (line 145) | class Solution {
    method countRangeSum (line 147) | int countRangeSum(vector<int>& nums, int lower, int upper) {

FILE: algorithms/cpp/countOfSmallerNumbersAfterSelf/countOfSmallerNumbersAfterSelf.cpp
  class Solution (line 31) | class Solution {
    method search (line 35) | int search(int t)
    method compute (line 45) | int compute(int t)
    method add (line 52) | void add(int t)
    method countSmaller (line 57) | vector<int> countSmaller(vector<int>& nums) {
    method countSmaller (line 139) | vector<int> countSmaller(vector<int>& nums) {
  class BinarySearchTreeNode (line 83) | class BinarySearchTreeNode
    method BinarySearchTreeNode (line 90) | BinarySearchTreeNode(int value) : val(value), less(0),count(1),left(NU...
  class BinarySearchTree (line 93) | class BinarySearchTree
    method BinarySearchTree (line 98) | BinarySearchTree(const int value):root(new BinarySearchTreeNode(value)...
    method insert (line 102) | void insert(const int value, int &numLessThan) {
    method freeTree (line 106) | void freeTree(BinarySearchTreeNode* root){
    method insert (line 113) | void insert(BinarySearchTreeNode* root, const int value, int &numLessT...
  class Solution (line 137) | class Solution {
    method search (line 35) | int search(int t)
    method compute (line 45) | int compute(int t)
    method add (line 52) | void add(int t)
    method countSmaller (line 57) | vector<int> countSmaller(vector<int>& nums) {
    method countSmaller (line 139) | vector<int> countSmaller(vector<int>& nums) {

FILE: algorithms/cpp/countPairsOfNodes/CountPairsOfNodes.cpp
  class Solution (line 107) | class Solution {
    method countPairs (line 109) | vector<int> countPairs(int n, vector<vector<int>>& edges, vector<int>&...

FILE: algorithms/cpp/countPairsWithXorInARange/CountPairsWithXorInARange.cpp
  type TrieNode (line 116) | struct TrieNode {
    method TrieNode (line 119) | TrieNode() {
  function insertTrie (line 127) | void insertTrie(TrieNode *root, int n) {
  class Solution (line 146) | class Solution {
    method countSmallerPairs (line 149) | int countSmallerPairs(TrieNode * root,  int N, int K) {
    method countPairs (line 177) | int countPairs(vector<int>& nums, int low, int high) {

FILE: algorithms/cpp/countPrimes/CountPrimes.cpp
  function countPrimes (line 117) | int countPrimes(int n) {
  function main (line 139) | int main(int argc, char**argv)

FILE: algorithms/cpp/countingBits/CountingBits.cpp
  class Solution (line 31) | class Solution {
    method countBits (line 59) | vector<int> countBits(int num) {

FILE: algorithms/cpp/courseSchedule/CourseSchedule.II.cpp
  class Solution (line 48) | class Solution {
    method topologicalSort (line 51) | bool topologicalSort( int n, vector<int>& explored, vector<int>& path,
    method findOrder (line 79) | vector<int> findOrder(int numCourses, vector<pair<int, int>>& prerequi...

FILE: algorithms/cpp/courseSchedule/CourseSchedule.cpp
  class Solution (line 44) | class Solution {
    method hasCycle (line 47) | bool hasCycle(int n, vector<int>& explored, vector<int>& path, map<int...
    method canFinish (line 69) | bool canFinish(int numCourses, vector<pair<int, int>>& prerequisites) {

FILE: algorithms/cpp/courseSchedule/non-recursive/course_schedule.cpp
  type _node (line 29) | struct _node {
    type _node (line 32) | struct _node
  class Solution (line 35) | class Solution {
    method canFinish (line 37) | bool canFinish(int numCourses, vector<pair<int, int>>& prerequisites) {
    method to_neighbor_repr (line 47) | vector<unordered_set<int>> to_neighbor_repr(int numOfvex, vector<Val>&...
    method dsf (line 62) | bool dsf(int numOfvex, vector<unordered_set<int>>& graph, vector<int>&...

FILE: algorithms/cpp/courseSchedule/non-recursive/main.cpp
  function main (line 17) | int main(int argc, const char * argv[]) {

FILE: algorithms/cpp/cousinsInBinaryTree/CousinsInBinaryTree.cpp
  class Solution (line 47) | class Solution {
    method isCousins (line 49) | bool isCousins(TreeNode* root, int x, int y) {
    method DepthAndParent (line 62) | int DepthAndParent(TreeNode* root, TreeNode*& parent, int depth, int x) {

FILE: algorithms/cpp/createMaximumNumber/CreateMaximumNumber.cpp
  class Solution (line 69) | class Solution {
    method maxNumber (line 71) | vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {
    method compareTwoArray (line 88) | bool compareTwoArray(vector<int>& nums1, int start1, vector<int>& nums...
    method mergeTwoArrays (line 99) | vector<int> mergeTwoArrays(vector<int>& nums1, vector<int>& nums2) {
    method findMaxSubArray (line 132) | vector<int> findMaxSubArray(vector<int>& nums, int k) {

FILE: algorithms/cpp/decodeString/DecodeString.cpp
  class Solution (line 27) | class Solution {
    method string (line 29) | string decodeString(string s) {
    method isValid (line 82) | bool isValid(string& s) {
    method isNum (line 101) | bool isNum(char ch) {

FILE: algorithms/cpp/decodeWays/decodeWays.cpp
  function check (line 34) | int check(char ch){
  function check (line 39) | int check(char ch1, char ch2){
  function numDecodings (line 44) | int numDecodings(string s) {
  function main (line 69) | int main(int argc, char**argv)

FILE: algorithms/cpp/decodeXORedPermutation/DecodeXoredPermutation.cpp
  class Solution (line 80) | class Solution {
    method decode (line 82) | vector<int> decode(vector<int>& encoded) {

FILE: algorithms/cpp/deleteNodeInALinkedList/DeleteNodeInALinkedList.cpp
  class Solution (line 23) | class Solution {
    method deleteNode (line 27) | void deleteNode(ListNode* node) {

FILE: algorithms/cpp/designAuthenticationManager/DesignAuthenticationManager.cpp
  class AuthenticationManager (line 63) | class AuthenticationManager {
    method AuthenticationManager (line 69) | AuthenticationManager(int timeToLive):ttl(timeToLive) { }
    method generate (line 71) | void generate(string tokenId, int currentTime) {
    method renew (line 76) | void renew(string tokenId, int currentTime) {
    method countUnexpiredTokens (line 87) | int countUnexpiredTokens(int currentTime) {
    method clean (line 91) | int clean(int expired) {

FILE: algorithms/cpp/detectCapital/DetectCapital.cpp
  class Solution (line 31) | class Solution {
    method is_lower (line 32) | bool is_lower(char ch) {
    method is_upper (line 35) | bool is_upper(char ch) {
    method is_alpha (line 38) | bool is_alpha(char ch) {
    method detectCapitalUse (line 42) | bool detectCapitalUse(string word) {

FILE: algorithms/cpp/determineColorOfAChessboardSquare/DetermineColorOfAChessboardSquare.cpp
  class Solution (line 39) | class Solution {
    method squareIsWhite (line 41) | bool squareIsWhite(string coordinates) {

FILE: algorithms/cpp/diameterOfBinaryTree/diameterOfBinaryTree.cpp
  class Solution (line 15) | class Solution {
    method maxDepth (line 18) | int maxDepth(TreeNode* root) {
    method diameterOfBinaryTree (line 26) | int diameterOfBinaryTree(TreeNode* root) {

FILE: algorithms/cpp/differentWaysToAddParentheses/DifferentWaysToAddParentheses.cpp
  function isOperator (line 39) | bool isOperator(char ch){
  function diffWaysToCompute (line 45) | vector<int> diffWaysToCompute(string input) {
  function printVector (line 89) | void printVector(vector<int>& v) {
  function main (line 97) | int main(int argc, char**argv)

FILE: algorithms/cpp/distinctSubsequences/distinctSubsequences.cpp
  function numDistinct1 (line 94) | int numDistinct1(string S, string T) {
  function numDistinct2 (line 146) | int numDistinct2(string S, string T) {
  function numDistinct (line 172) | int numDistinct(string S, string T) {
  function main (line 183) | int main(int argc, char** argv)

FILE: algorithms/cpp/distributeCoinsInBinaryTree/DistributeCoinsInBinaryTree.cpp
  class Solution (line 55) | class Solution {
    method distributeCoins (line 57) | int distributeCoins(TreeNode* root) {
    method dfs (line 79) | int dfs(TreeNode* root, int& result) {

FILE: algorithms/cpp/divideTwoInt/divideTwoInt.cpp
  function divide (line 21) | int divide(int dividend, int divisor) {
  function main (line 54) | int main()

FILE: algorithms/cpp/dungeonGame/dungeonGame.cpp
  class Solution (line 48) | class Solution {
    method calculateMinimumHP (line 50) | int calculateMinimumHP(vector<vector<int> > &dungeon) {

FILE: algorithms/cpp/editDistance/editDistance.cpp
  function min (line 81) | int min(int x, int y, int z) {
  function minDistance (line 85) | int minDistance(string word1, string word2) {
  function main (line 115) | int main(int argc, char**argv)

FILE: algorithms/cpp/eggDropWith2EggsAndNFloors/EggDropWith2EggsAndNFloors.cpp
  class Solution (line 79) | class Solution {
    method twoEggDrop (line 81) | int twoEggDrop(int n) {

FILE: algorithms/cpp/eliminationGame/EliminationGame.cpp
  class Solution (line 30) | class Solution {
    method lastRemaining (line 32) | int lastRemaining(int n) {

FILE: algorithms/cpp/equalSumArraysWithMinimumNumberOfOperations/EqualSumArraysWithMinimumNumberOfOperations.cpp
  class Solution (line 50) | class Solution {
    method print (line 52) | void print(vector<int>& n) {
    method minOpsBySort (line 60) | int minOpsBySort(int gaps, vector<int>& small, vector<int>& big) {
    method minOpsByCnt1 (line 84) | int minOpsByCnt1(int gaps, vector<int>& small, vector<int>& big) {
    method minOpsByCnt2 (line 110) | int minOpsByCnt2(int gaps, vector<int>& small, vector<int>& big) {
    method minOperations (line 129) | int minOperations(vector<int>& nums1, vector<int>& nums2) {

FILE: algorithms/cpp/evaluateDivision/EvaluateDivision.cpp
  class Solution (line 28) | class Solution {
    method dfs (line 30) | bool dfs( unordered_map<string, unordered_map<string, double>>& m,
    method calcEquation (line 62) | vector<double> calcEquation(vector<pair<string, string>> equations,

FILE: algorithms/cpp/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp
  class Solution (line 28) | class Solution {
    method evalRPN (line 30) | int evalRPN(vector<string> &tokens) {
    method isOp (line 75) | bool isOp(string &op) {
    method isNum (line 79) | bool isNum(string &num) {
  function main (line 90) | int main()

FILE: algorithms/cpp/evaluateTheBracketPairsOfAString/EvaluateTheBracketPairsOfAString.cpp
  class Solution (line 68) | class Solution {
    method isBracket (line 70) | bool isBracket(char c) {
    method string (line 74) | string evaluate(string s, vector<vector<string>>& knowledge) {

FILE: algorithms/cpp/excelSheetColumnNumber/excelSheetColumnNumber.cpp
  function string (line 31) | string base26_int2str(long long n) {
  function base26_str2int (line 42) | long long base26_str2int(string& s){
  function string (line 52) | string titleToNumber(int n) {
  function main (line 56) | int main(int argc, char**argv)

FILE: algorithms/cpp/excelSheetColumnTitle/excelSheetColumnTitle.cpp
  function string (line 30) | string base26_int2str(long long n) {
  function base26_str2int (line 41) | long long base26_str2int(string& s){
  function string (line 51) | string convertToTitle(int n) {
  function main (line 55) | int main(int argc, char**argv)

FILE: algorithms/cpp/expressionAddOperators/ExpressionAddOperators.cpp
  class Solution (line 23) | class Solution {
    method addOperators (line 25) | vector<string> addOperators(string num, int target) {
    method helper (line 33) | void helper(const string &num, const int target, //`num` and `target` ...

FILE: algorithms/cpp/factorialTrailingZeroes/factorialTrailingZeroes.cpp
  class Solution (line 63) | class Solution {
    method trailingZeroes (line 65) | int trailingZeroes(int n) {
    method trailingZeroes (line 75) | int trailingZeroes(int n) {

FILE: algorithms/cpp/fibonacciNumber/FibonacciNumber.cpp
  class Solution (line 38) | class Solution {
    method fib (line 40) | int fib(int N) {

FILE: algorithms/cpp/filterRestaurantsByVeganFriendlyPriceAndDistance/FilterRestaurantsByVeganFriendlyPriceAndDistance.cpp
  function cmp (line 59) | static bool cmp(const vector<int>& v1, const vector<int>& v2) {
  class Solution (line 62) | class Solution {
    method filterRestaurants (line 64) | vector<int> filterRestaurants(vector<vector<int>>& restaurants, int ve...

FILE: algorithms/cpp/findAllAnagramsInAString/Find-All-Anagrams-in-a-String.cpp
  class Solution (line 38) | class Solution {
    method findAnagrams (line 40) | vector<int> findAnagrams(string s, string p) {

FILE: algorithms/cpp/findKthLargestXorCoordinateValue/FindKthLargestXorCoordinateValue.cpp
  class Solution (line 49) | class Solution {
    method print (line 51) | void print(vector<vector<int>>& m) {
    method kthLargestValue (line 63) | int kthLargestValue(vector<vector<int>>& matrix, int k) {

FILE: algorithms/cpp/findMedianFromDataStream/FindMedianFromDataStream.cpp
  class MedianFinder (line 33) | class MedianFinder {
    method addNum (line 42) | void addNum(int num) {
    method findMedian (line 63) | double findMedian() {

FILE: algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp
  function findMin (line 40) | int findMin(vector<int> &num) {
  function rotate_array (line 75) | void rotate_array(int a[], int n, int pos){
  function printArray (line 103) | void printArray(int A[], int n) {
  function main (line 111) | int main(int argc, char** argv)

FILE: algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp
  function findMin (line 29) | int findMin(vector<int> &num) {
  function rotate_array (line 63) | void rotate_array(int a[], int n, int pos){
  function printArray (line 91) | void printArray(int A[], int n) {
  function main (line 99) | int main(int argc, char** argv)

FILE: algorithms/cpp/findNearestPointThatHasTheSameXOrYCoordinate/FindNearestPointThatHasTheSameXOrYCoordinate.cpp
  class Solution (line 45) | class Solution {
    method nearestValidPoint (line 47) | int nearestValidPoint(int x, int y, vector<vector<int>>& points) {

FILE: algorithms/cpp/findPeakElement/findPeakElement.cpp
  function findPeakElement (line 52) | int findPeakElement(const vector<int> &num) {
  function printVector (line 87) | void printVector(vector<int> &n) {
  function test (line 96) | void test(int a[], int n) {
  function main (line 105) | int main(int argc, char**argv)

FILE: algorithms/cpp/findTheDifference/FindTheDifference.cpp
  class Solution (line 27) | class Solution {
    method findTheDifference (line 29) | char findTheDifference(string s, string t) {

FILE: algorithms/cpp/findTheDuplicateNumber/findTheDuplicateNumber.cpp
  class Solution (line 25) | class Solution {
    method findDuplicate (line 33) | int findDuplicate(vector<int>& nums) {

FILE: algorithms/cpp/findTheHighestAltitude/FindTheHighestAltitude.cpp
  class Solution (line 32) | class Solution {
    method largestAltitude (line 34) | int largestAltitude(vector<int>& gain) {

FILE: algorithms/cpp/findTheWinnerOfAnArrayGame/FindTheWinnerOfAnArrayGame.cpp
  class Solution (line 53) | class Solution {
    method getWinner (line 55) | int getWinner(vector<int>& arr, int k) {

FILE: algorithms/cpp/findTheWinnerOfTheCircularGame/FindTheWinnerOfTheCircularGame.cpp
  class Solution (line 50) | class Solution {
    method findTheWinner (line 52) | int findTheWinner(int n, int k) {

FILE: algorithms/cpp/findXorSumOfAllPairsBitwiseAnd/FindXorSumOfAllPairsBitwiseAnd.cpp
  class Solution (line 39) | class Solution {
    method getXORSum (line 41) | int getXORSum(vector<int>& arr1, vector<int>& arr2) {

FILE: algorithms/cpp/findingMkAverage/FindingMkAverage.cpp
  class MKAverage (line 61) | class MKAverage {
    method print (line 72) | void print(T& v) {
    method takeMax (line 78) | int takeMax(multiset<int>& s) {
    method takeMin (line 84) | int takeMin(multiset<int>& s) {
    method MKAverage (line 91) | MKAverage(int _m, int _k): ring(_m, 0), m(_m), k(_k), sum(0), pos(0), ...
    method ins (line 95) | void ins(int n) {
    method del (line 109) | void del(int n) {
    method addElement (line 125) | void addElement(int num) {
    method calculateMKAverage (line 144) | int calculateMKAverage() {
  class MKAverage1 (line 169) | class MKAverage1 {
    method print (line 180) | void print(T& v) {
    method MKAverage1 (line 187) | MKAverage1(int _m, int _k):  ring(_m,0), m(_m), k(_k), sum(0), pos(0),...
    method ins (line 190) | void ins(int n) {
    method del (line 208) | void del(int n) {
    method addElement (line 225) | void addElement(int num) {
    method calculateMKAverage (line 259) | int calculateMKAverage() {

FILE: algorithms/cpp/findingTheUsersActiveMinutes/FindingTheUsersActiveMinutes.cpp
  class Solution (line 51) | class Solution {
    method findingUsersActiveMinutes (line 53) | vector<int> findingUsersActiveMinutes(vector<vector<int>>& logs, int k) {

FILE: algorithms/cpp/firstBadVersion/FirstBadVersion.cpp
  class Solution (line 27) | class Solution {
    method firstBadVersion (line 30) | int firstBadVersion(int n) {

FILE: algorithms/cpp/firstMissingPositive/firstMissingPositive.cpp
  function firstMissingPositive_move (line 38) | int firstMissingPositive_move(int A[], int n) {
  function firstMissingPositive_map (line 74) | int firstMissingPositive_map(int A[], int n) {
  function firstMissingPositive (line 120) | int firstMissingPositive(int A[], int n) {
  function printArray (line 129) | void printArray(int a[], int n){
  function Test (line 137) | void Test(int a[], int n, int expected) {
  function main (line 145) | int main()

FILE: algorithms/cpp/firstUniqueCharacterInAString/FirstUniqueCharacterInAString.cpp
  class Solution (line 21) | class Solution {
    method firstUniqChar (line 23) | int firstUniqChar(string s) {

FILE: algorithms/cpp/fizzBuzz/FizzBuzz.cpp
  class Solution (line 37) | class Solution {
    method fizzBuzz_old_school_way (line 39) | vector<string> fizzBuzz_old_school_way(int n) {
    class FizzBuzz (line 56) | class FizzBuzz {
      method FizzBuzz (line 58) | FizzBuzz() : x(0) {}
      method string (line 60) | string operator()() {
    method fizzBuzz_cpp_way (line 76) | vector<string> fizzBuzz_cpp_way(int n) {
    method fizzBuzz (line 82) | vector<string> fizzBuzz(int n) {

FILE: algorithms/cpp/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp
  class Solution (line 48) | class Solution {
    method flatten (line 50) | void flatten(TreeNode *root) {

FILE: algorithms/cpp/flattenNestedListIterator/FlattenNestedListIterator.cpp
  class NestedIterator (line 42) | class NestedIterator {
    method flatten (line 46) | void flatten(vector<NestedInteger> &nestedList) {
    method NestedIterator (line 56) | NestedIterator(vector<NestedInteger> &nestedList) {
    method next (line 61) | int next() {
    method hasNext (line 65) | bool hasNext() {

FILE: algorithms/cpp/formArrayByConcatenatingSubarraysOfAnotherArray/FormArrayByConcatenatingSubarraysOfAnotherArray.cpp
  class Solution (line 51) | class Solution {
    method canChoose (line 53) | bool canChoose(vector<vector<int>>& groups, vector<int>& nums) {

FILE: algorithms/cpp/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp
  function string (line 46) | string fractionToDecimal(int numerator, int denominator) {
  function test (line 95) | void test(int num, int deno)
  function main (line 100) | int main(int argc, char** argv)

FILE: algorithms/cpp/frequencyOfTheMostFrequentElement/FrequencyOfTheMostFrequentElement.cpp
  class Solution (line 43) | class Solution {
    method maxFrequency (line 45) | int maxFrequency(vector<int>& nums, int k) {

FILE: algorithms/cpp/friendCircles/FriendCircles.cpp
  class Solution (line 46) | class Solution {
    method findCircleNum_DFS (line 51) | int findCircleNum_DFS(vector<vector<int>>& M) {
    method mark (line 65) | void mark(vector<vector<int>>& M, int i ) {
    method findCircleNum_UF (line 76) | int findCircleNum_UF(vector<vector<int>>& M) {
    method find (line 96) | int find(vector<int>& relations, int i ) {
    method join (line 104) | bool join(vector<int> &relations, int x, int y) {
    method findCircleNum (line 113) | int findCircleNum(vector<vector<int>>& M) {

FILE: algorithms/cpp/frogJump/FrogJump.cpp
  class Solution (line 46) | class Solution {
    method canCross_recursion (line 48) | bool canCross_recursion(vector<int>& stones, int curr, int last_jump) {
    method canCross_recursion_with_cache (line 61) | bool canCross_recursion_with_cache(vector<int>& stones, int curr, int ...
    method canCross_non_recursion (line 82) | bool canCross_non_recursion(vector<int>& stones) {
    method canCross (line 112) | bool canCross(vector<int>& stones) {

FILE: algorithms/cpp/gameOfLife/GameOfLife.cpp
  class Solution (line 51) | class Solution {
    method liveCheck (line 58) | void liveCheck(vector<vector<int>>& board, int r, int c) {
    method gameOfLife (line 79) | void gameOfLife(vector<vector<int>>& board) {

FILE: algorithms/cpp/gasStation/gasStation.cpp
  class Solution (line 20) | class Solution {
    method canCompleteCircuit (line 22) | int canCompleteCircuit(vector<int> &gas, vector<int> &cost) {

FILE: algorithms/cpp/generateParentheses/generateParentheses.cpp
  function generateParenthesis (line 23) | vector<string> generateParenthesis(int n) {
  function generator (line 31) | void generator(vector<string>& result, int left, int right, string s){
  function printResult (line 44) | void printResult(vector<string>& result)
  function main (line 51) | int main(int argc, char** argv)

FILE: algorithms/cpp/grayCode/grayCode.cpp
  function grayCode01 (line 73) | vector<int> grayCode01(int n) {
  function grayCode02 (line 102) | vector<int> grayCode02(int n) {
  function grayCode (line 112) | vector<int> grayCode(int n) {
  function printBits (line 120) | void printBits(int n, int len){
  function printVector (line 130) | void printVector(vector<int>& v, int bit_len)
  function main (line 143) | int main(int argc, char** argv)

FILE: algorithms/cpp/greatestCommonDivisorOfStrings/GreatestCommonDivisorOfStrings.cpp
  class Solution (line 34) | class Solution {
    method findGCD_r (line 41) | int findGCD_r(int a, int b) {
    method findGCD (line 47) | int findGCD(int a, int b) {
    method isStrRepeatByLen (line 57) | bool isStrRepeatByLen(string& s, int len) {
    method strPrefixComp (line 68) | bool strPrefixComp(string& s1, string &s2, int len){
    method string (line 75) | string gcdOfStrings(string s1, string s2) {

FILE: algorithms/cpp/h-Index/h-Index.II.cpp
  class Solution (line 14) | class Solution {
    method hIndex (line 17) | int hIndex(vector<int>& citations) {

FILE: algorithms/cpp/h-Index/h-Index.cpp
  class Solution (line 41) | class Solution {
    method hIndex (line 43) | int hIndex(vector<int>& citations) {
    method hIndex01 (line 47) | int hIndex01(vector<int>& citations) {
    method hIndex02 (line 57) | int hIndex02(vector<int>& citations) {

FILE: algorithms/cpp/happyNumber/HappyNumber.cpp
  function squares (line 29) | int squares(int n) {
  function isHappy (line 39) | bool isHappy(int n) {
  function main (line 59) | int main(int argc, char** argv)

FILE: algorithms/cpp/houseRobber/houseRobber.II.cpp
  class Solution (line 23) | class Solution {
    method orginal_rob (line 25) | int orginal_rob(vector<int> &money, int start, int end) {
    method rob (line 37) | int rob(vector<int>& nums) {

FILE: algorithms/cpp/houseRobber/houseRobber.cpp
  function rob1 (line 38) | int rob1(vector<int> &money) {
  function rob2 (line 57) | int rob2(vector<int> &money) {
  function rob (line 69) | int rob(vector<int> &num) {
  function printVector (line 75) | void printVector( vector<int> &v ){
  function main (line 83) | int main(int argc, char** argv) {

FILE: algorithms/cpp/houseRobber/houseRobberIII.cpp
  class Solution (line 68) | class Solution {
    method rob (line 71) | int rob(TreeNode* root) {
    method max (line 95) | int max(int a, int b) {
    method max (line 98) | int max(int a, int b, int c) {
    method max (line 101) | int max(int a, int b, int c, int d) {
    method rob_or_not (line 105) | void rob_or_not(TreeNode* root, int& max_robbed, int& max_not_robbed) {
    method rob (line 129) | int rob(TreeNode* root) {
  class Solution (line 93) | class Solution {
    method rob (line 71) | int rob(TreeNode* root) {
    method max (line 95) | int max(int a, int b) {
    method max (line 98) | int max(int a, int b, int c) {
    method max (line 101) | int max(int a, int b, int c, int d) {
    method rob_or_not (line 105) | void rob_or_not(TreeNode* root, int& max_robbed, int& max_not_robbed) {
    method rob (line 129) | int rob(TreeNode* root) {

FILE: algorithms/cpp/implementQueueUsingStacks/ImplementQueueUsingStacks.cpp
  class Queue (line 31) | class Queue {
    method push (line 34) | void push(int x) {
    method pop (line 39) | void pop(void) {
    method peek (line 46) | int peek(void) {
    method empty (line 54) | bool empty(void) {
    method transfer (line 59) | void transfer(stack<int>& s1, stack<int>& s2) {

FILE: algorithms/cpp/implementStackUsingQueues/ImplementStackUsingQueues.cpp
  class Stack (line 37) | class Stack {
    method push (line 40) | void push(int x) {
    method pop (line 44) | void pop() {
    method top (line 56) | int top() {
    method empty (line 60) | bool empty() {

FILE: algorithms/cpp/implementTriePrefixTree/ImplementTriePrefixTree.cpp
  class TrieNode (line 16) | class TrieNode {
    method TrieNode (line 19) | TrieNode():isWord(false) {   }
  class Trie (line 24) | class Trie {
    method Trie (line 26) | Trie() {
    method insert (line 31) | void insert(string s) {
    method search (line 44) | bool search(string key) {
    method startsWith (line 50) | bool startsWith(string prefix) {
    method retrieve (line 56) | inline bool retrieve(const string& key, bool isWord) {

FILE: algorithms/cpp/increasingTripletSubsequence/increasingTripletSubsequence.cpp
  class Solution (line 23) | class Solution {
    method increasingTriplet (line 25) | bool increasingTriplet(vector<int>& nums) {
    method increasingTriplet (line 49) | bool increasingTriplet(vector<int>& nums) {
  class Solution (line 47) | class Solution {
    method increasingTriplet (line 25) | bool increasingTriplet(vector<int>& nums) {
    method increasingTriplet (line 49) | bool increasingTriplet(vector<int>& nums) {

FILE: algorithms/cpp/incrementalMemoryLeak/IncrementalMemoryLeak.cpp
  class Solution (line 52) | class Solution {
    method memLeak (line 54) | vector<int> memLeak(int memory1, int memory2) {

FILE: algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1.cpp
  class RandomizedSet (line 42) | class RandomizedSet {
    method RandomizedSet (line 45) | RandomizedSet() {
    method insert (line 50) | bool insert(int val) {
    method remove (line 58) | bool remove(int val) {
    method getRandom (line 79) | int getRandom() {
    method find (line 86) | bool find(int val) {

FILE: algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1DuplicatesAllowed.cpp
  class RandomizedCollection (line 42) | class RandomizedCollection {
    method RandomizedCollection (line 45) | RandomizedCollection() {
    method insert (line 50) | bool insert(int val) {
    method remove (line 57) | bool remove(int val) {
    method getRandom (line 84) | int getRandom() {
    method find (line 90) | bool find(int val) {

FILE: algorithms/cpp/insertInterval/insertInterval.cpp
  type Interval (line 27) | struct Interval {
    method Interval (line 30) | Interval() : start(0), end(0) {}
    method Interval (line 31) | Interval(int s, int e) : start(s), end(e) {}
  function compare (line 35) | bool compare(const Interval& lhs, const Interval& rhs){
  function merge (line 39) | vector<Interval> merge(vector<Interval> &intervals) {
  function insert (line 61) | vector<Interval> insert(vector<Interval> &intervals, Interval newInterva...
  function main (line 68) | int main(int argc, char**argv)

FILE: algorithms/cpp/insertionSortList/insertionSortList.cpp
  type ListNode (line 15) | struct ListNode {
    method ListNode (line 18) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 21) | ListNode *insertionSortList(ListNode *head) {
    method ListNode (line 18) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 48) | void printList(ListNode* h)
  function ListNode (line 57) | ListNode* createList(int a[], int n)
    method ListNode (line 18) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 72) | int main(int argc, char** argv)

FILE: algorithms/cpp/integerBreak/IntegerBreak.cpp
  class Solution (line 23) | class Solution {
    method integerBreak (line 34) | int integerBreak(int n) {
    method integerBreak (line 50) | int integerBreak(int n) {
  class Solution (line 48) | class Solution {
    method integerBreak (line 34) | int integerBreak(int n) {
    method integerBreak (line 50) | int integerBreak(int n) {

FILE: algorithms/cpp/integerReplacement/IntegerReplacement.cpp
  class Solution (line 39) | class Solution {
    method integerReplacement_recursion (line 43) | int integerReplacement_recursion(int n) {
    method integerReplacement_recursionWithCache (line 50) | int integerReplacement_recursionWithCache(int n) {
    method integerReplacement_simple (line 66) | int integerReplacement_simple(int n){
    method integerReplacement (line 80) | int integerReplacement(int n) {

FILE: algorithms/cpp/integerToEnglishWords/IntegerToEnglishWords.cpp
  function string (line 42) | string numberLess1000ToWords(int num) {
  function string (line 64) | string numberToWords(int num) {
  function main (line 89) | int main(int argc, char** argv)

FILE: algorithms/cpp/integerToRoman/integerToRoman.cpp
  function string (line 19) | string intToRoman(int num) {
  function main (line 35) | int main(int argc, char** argv)

FILE: algorithms/cpp/interleavingString/interleavingString.cpp
  function isInterleave (line 67) | bool isInterleave(string s1, string s2, string s3) {
  function isInterleave_dfs (line 106) | bool isInterleave_dfs(string s1, string s2, string s3) {
  function main (line 130) | int main(int argc, char**argv)

FILE: algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArrays.cpp
  class Solution (line 17) | class Solution {
    method intersection (line 21) | vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
    method intersection (line 57) | vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
  class Solution2 (line 36) | class Solution2 {
    method intersection (line 38) | vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
  class Solution (line 55) | class Solution {
    method intersection (line 21) | vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
    method intersection (line 57) | vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {

FILE: algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArraysII.cpp
  class Solution (line 39) | class Solution { // O(NlogN + MlogM)
    method intersect (line 41) | vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {
    method intersect (line 73) | vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {
  class Solution (line 71) | class Solution {
    method intersect (line 41) | vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {
    method intersect (line 73) | vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {

FILE: algorithms/cpp/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp
  class Solution (line 37) | class Solution {
    method ListNode (line 39) | ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
    method getListLength (line 66) | inline int getListLength(ListNode *head){

FILE: algorithms/cpp/intervalListIntersectons/IntervalListIntersections.cpp
  class Solution (line 49) | class Solution {
    method compareInterval (line 52) | bool compareInterval(Interval& lhs, Interval& rhs) {
    method overlapped (line 56) | bool overlapped(Interval& lhs, Interval& rhs) {
    method Interval (line 63) | Interval mergeTwoInterval(Interval& lhs, Interval& rhs) {
    method intervalIntersection (line 70) | vector<Interval> intervalIntersection(vector<Interval>& A, vector<Inte...

FILE: algorithms/cpp/invertBinaryTree/InvertBinaryTree.cpp
  class Solution (line 39) | class Solution {
    method TreeNode (line 42) | TreeNode* invertTree_recursive(TreeNode* root) {
    method TreeNode (line 50) | TreeNode* invertTree_non_recursive(TreeNode* root) {
    method TreeNode (line 64) | TreeNode* invertTree(TreeNode* root) {

FILE: algorithms/cpp/isSubsequence/IsSubsequence.cpp
  class Solution (line 33) | class Solution {
    method isSubsequence (line 35) | bool isSubsequence(string s, string t) {

FILE: algorithms/cpp/islandPerimeter/IslandPerimeter.cpp
  class Solution (line 30) | class Solution {
    method edge (line 32) | int edge(vector<vector<int>> &grid, int x, int y) {
    method islandPerimeter (line 45) | int islandPerimeter(vector<vector<int>>& grid) {

FILE: algorithms/cpp/isomorphicStrings/IsomorphicStrings.cpp
  class Solution (line 29) | class Solution {
    method isIsomorphic (line 31) | bool isIsomorphic(string s, string t) {

FILE: algorithms/cpp/jewelsAndStones/JewelsAndStones.cpp
  class Solution (line 36) | class Solution {
    method numJewelsInStones (line 38) | int numJewelsInStones(string J, string S) {

FILE: algorithms/cpp/jumpGame/jumpGame.II.cpp
  function jump (line 26) | int jump(int A[], int n) {
  function printArray (line 54) | void printArray(int a[], int n){
  function main (line 62) | int main()

FILE: algorithms/cpp/jumpGame/jumpGame.cpp
  class Solution (line 21) | class Solution {
    method canJump (line 23) | bool canJump(int A[], int n) {

FILE: algorithms/cpp/kthLargestElementInAnArray/KthLargestElementInAnArray.cpp
  class Solution (line 23) | class Solution {
    method findKthLargest_buildin (line 26) | int findKthLargest_buildin(vector<int>& nums, int k) {
    method partition (line 33) | int partition(vector<int>& nums, int left, int right) {
    method findKthLargest_qsort (line 47) | int findKthLargest_qsort(vector<int>& nums, int k) {
    method findKthLargest (line 63) | int findKthLargest(vector<int>& nums, int k) {

FILE: algorithms/cpp/kthSmallestElementInaBST/KthSmallestElementInABst.cpp
  class Solution (line 33) | class Solution {
    method kthSmallestHelper_recursive (line 36) | int kthSmallestHelper_recursive(TreeNode* root, int& k) {
    method kthSmallestHelper_nonRecursive (line 50) | int kthSmallestHelper_nonRecursive(TreeNode* root, int k){
    method kthSmallest (line 70) | int kthSmallest(TreeNode* root, int k) {

FILE: algorithms/cpp/largestColorValueInADirectedGraph/LargestColorValueInADirectedGraph.cpp
  class Node (line 46) | class Node {
    method Node (line 48) | Node(char c) {
    method AddMyColor (line 54) | void AddMyColor() { colors[color]++; }
    method Processed (line 55) | void Processed() { processed = true; }
    method isProcessed (line 56) | bool isProcessed() { return processed; }
    method AddIncomming (line 57) | void AddIncomming(int n=1) { incomming += n;}
    method Incomming (line 58) | int Incomming() {return incomming;}
    method AddChildNode (line 59) | void AddChildNode(int n) { children.push_back(n); }
    method ChildrenCount (line 61) | int ChildrenCount() { return children.size(); }
    method MaxColorValue (line 63) | int MaxColorValue() {
    method MergeChildColors (line 70) | void MergeChildColors(Node& child){
  class Solution (line 86) | class Solution {
    method print (line 88) | void print(vector<int>& v) {
    method largestPathValue (line 100) | int largestPathValue(string colors, vector<vector<int>>& edges) {
    method topologicalSort (line 140) | void topologicalSort(int i, vector<int>& topSort, vector<bool>& visite...
    method travel (line 153) | bool travel(int i, vector<bool>& visited ) {

FILE: algorithms/cpp/largestMergeOfTwoStrings/LargestMergeOfTwoStrings.cpp
  class Solution (line 53) | class Solution {
    method string_cmp (line 55) | bool string_cmp(string& s1, int p1, string& s2, int p2) {
    method string (line 63) | string largestMerge(string word1, string word2) {

FILE: algorithms/cpp/largestNumber/largestNumber.cpp
  class Solution (line 17) | class Solution {
    method comp (line 21) | static bool comp (string& s1, string& s2) { return s1+s2 > s2+s1; }
    method string (line 23) | string largestNumber(vector<int> &num) {

FILE: algorithms/cpp/largestNumberAfterMutatingSubstring/LargestNumberAfterMutatingSubstring.cpp
  class Solution (line 53) | class Solution {
    method string (line 55) | string maximumNumber(string num, vector<int>& change) {

FILE: algorithms/cpp/largestPerimeterTriangle/largestPerimeterTriangle.cpp
  class Solution (line 1) | class Solution {
    method largestPerimeter (line 3) | int largestPerimeter(vector<int>& A) {

FILE: algorithms/cpp/largestRectangleInHistogram/largestRectangleInHistogram.cpp
  function largestRectangleArea_01 (line 58) | int largestRectangleArea_01(vector<int>& heights) {
  function largestRectangleArea (line 158) | int largestRectangleArea(vector<int> &height) {
  function printArray (line 187) | void printArray(vector<int> &v)
  function test (line 195) | void test(int a[], int n)
  function main (line 202) | int main()

FILE: algorithms/cpp/largestSubmatrixWithRearrangements/LargestSubmatrixWithRearrangements.cpp
  class Solution (line 48) | class Solution {
    method largestSubmatrix (line 50) | int largestSubmatrix(vector<vector<int>>& matrix) {

FILE: algorithms/cpp/largestSubstringBetweenTwoEqualCharacters/LargestSubstringBetweenTwoEqualCharacters.cpp
  class Solution (line 42) | class Solution {
    method maxLengthBetweenEqualCharacters (line 44) | int maxLengthBetweenEqualCharacters(string s) {

FILE: algorithms/cpp/latestTimeByReplacingHiddenDigits/LatestTimeByReplacingHiddenDigits.cpp
  class Solution (line 37) | class Solution {
    method string (line 39) | string maximumTime(string time) {

FILE: algorithms/cpp/lengthOfLastWord/lengthOfLastWord.cpp
  function lengthOfLastWord (line 24) | int lengthOfLastWord(const char *s) {
  function main (line 47) | int main(int argc, char** argv)

FILE: algorithms/cpp/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp
  function letterCombinations (line 26) | vector<string> letterCombinations(string digits) {
  function printVector (line 73) | void printVector(vector<string>& ss){
  function main (line 82) | int main(int argc, char**argv)

FILE: algorithms/cpp/lexicographicalNumbers/LexicographicalNumbers.cpp
  class Solution (line 14) | class Solution {
    method lexicalOrder01 (line 18) | vector<int> lexicalOrder01(int n) {
    method myComp (line 27) | static bool myComp(int i,int j) {
    method lexicalOrder02 (line 37) | vector<int> lexicalOrder02(int n) {
    method lexicalOrder_helper (line 47) | void lexicalOrder_helper(int num, int& n, vector<int>& result) {
    method lexicalOrder03 (line 60) | vector<int> lexicalOrder03(int n) {
    method lexicalOrder (line 101) | vector<int> lexicalOrder(int n) {

FILE: algorithms/cpp/lexicographicallySmallestStringAfterApplyingOperations/LexicographicallySmallestStringAfterApplyingOperations.cpp
  class Solution (line 72) | class Solution {
    method rotate_str (line 75) | void rotate_str(string& s, int n) {
    method add_str (line 78) | void add_str(string& s, int n) {
    method string (line 84) | string findLexSmallestString(string s, int a, int b) {
    method dfs (line 90) | void dfs(string& s, int a, int b, string& result) {

FILE: algorithms/cpp/linkedListCycle/linkedListCycle.II.cpp
  class Solution (line 23) | class Solution {
    method hasCycle (line 28) | bool hasCycle(ListNode *head) {
    method ListNode (line 55) | ListNode *detectCycle(ListNode *head) {

FILE: algorithms/cpp/linkedListCycle/linkedListCycle.cpp
  class Solution (line 24) | class Solution {
    method hasCycle (line 26) | bool hasCycle(ListNode *head) {
    method hasCycle01 (line 35) | bool hasCycle01(ListNode *head) {
    method hasCycle02 (line 47) | bool hasCycle02(ListNode *head) {
    method hasCycle03 (line 62) | bool hasCycle03(ListNode *head) {
    method hasCycle04 (line 74) | bool hasCycle04(ListNode *head) {

FILE: algorithms/cpp/linkedListRandomNode/LinkedListRandomNode.cpp
  class Solution (line 35) | class Solution {
    method Solution (line 39) | Solution(ListNode* head) {
    method getRandom (line 47) | int getRandom() {

FILE: algorithms/cpp/longerContiguousSegmentsOfOnesThanZeros/LongerContiguousSegmentsOfOnesThanZeros.cpp
  class Solution (line 49) | class Solution {
    method checkZeroOnes (line 51) | bool checkZeroOnes(string s) {

FILE: algorithms/cpp/longestAbsoluteFilePath/LongestAbsoluteFilePath.cpp
  class Solution (line 55) | class Solution {
    method lengthLongestPath (line 74) | int lengthLongestPath(string input) {

FILE: algorithms/cpp/longestCommonPrefix/longestCommonPrefix.cpp
  function string (line 18) | string longestCommonPrefix(vector<string> &strs) {
  function main (line 39) | int main()

FILE: algorithms/cpp/longestConsecutiveSequence/longestConsecutiveSequence.cpp
  class Solution (line 34) | class Solution {
    method longestConsecutive (line 36) | int longestConsecutive(vector<int> &num) {

FILE: algorithms/cpp/longestIncreasingPathInAMatrix/LongestIncreasingPathInAMatrix.cpp
  class Solution (line 42) | class Solution {
    method longestIncreasingPath (line 44) | int longestIncreasingPath(vector<vector<int>>& matrix) {
    method helper (line 57) | int helper(vector<vector<int>>& matrix, vector<vector<int>>& path, con...

FILE: algorithms/cpp/longestIncreasingSubsequence/longestIncreasingSubsequence.cpp
  class Solution (line 28) | class Solution {
    method lengthOfLIS (line 30) | int lengthOfLIS(vector<int>& nums) {
    method lengthOfLIS (line 67) | int lengthOfLIS(vector<int>& nums) {
    method binary_search (line 102) | int binary_search(int number)
    method lengthOfLIS (line 130) | int lengthOfLIS(vector<int>& nums) {
  class Solution (line 49) | class Solution {
    method lengthOfLIS (line 30) | int lengthOfLIS(vector<int>& nums) {
    method lengthOfLIS (line 67) | int lengthOfLIS(vector<int>& nums) {
    method binary_search (line 102) | int binary_search(int number)
    method lengthOfLIS (line 130) | int lengthOfLIS(vector<int>& nums) {

FILE: algorithms/cpp/longestNiceSubstring/LongestNiceSubstring.cpp
  class Solution (line 47) | class Solution {
    method getCharIndex (line 48) | inline int getCharIndex(char c) {
    method getCaseIndex (line 51) | inline int getCaseIndex(char c) {
    method string (line 55) | string longestNiceSubstring(string s) {

FILE: algorithms/cpp/longestPalindrome/LongestPalindrome.cpp
  class Solution (line 27) | class Solution {
    method longestPalindrome (line 29) | int longestPalindrome(string s) {

FILE: algorithms/cpp/longestPalindromicSubsequence/LongestPalindromicSubsequence.cpp
  class Solution (line 68) | class Solution {
    method longestPalindromeSubseq (line 70) | int longestPalindromeSubseq(string s) {

FILE: algorithms/cpp/longestPalindromicSubstring/longestPalindromicSubstring.cpp
  function string (line 19) | string findPalindrome(string s, int left, int right)
  function string (line 35) | string longestPalindrome_recursive_way(string s) {
  function findPalindrome (line 59) | void findPalindrome(string s, int left, int right, int& start, int& len)
  function string (line 76) | string longestPalindrome_recursive_way2(string s) {
  function string (line 95) | string longestPalindrome_dp_way(string s) {
  function string (line 132) | string longestPalindrome_dp_opt_way(string s) {
  function string (line 176) | string longestPalindrome(string s) {
  function main (line 183) | int main(int argc, char**argv)

FILE: algorithms/cpp/longestSubstringOfAllVowelsInOrder/LongestSubstringOfAllVowelsInOrder.cpp
  class Solution (line 45) | class Solution {
    type Vowels (line 47) | enum Vowels{
    method Vowels (line 56) | Vowels isVowels(char c) {
    method longestBeautifulSubstring (line 67) | int longestBeautifulSubstring(string word) {

FILE: algorithms/cpp/longestSubstringWithAtLeastKRepeatingCharacters/LongestSubstringWithAtLeastKRepeatingCharacters.cpp
  class Solution (line 42) | class Solution {
    method longestSubstring (line 44) | int longestSubstring(string s, int k) {
    method max (line 91) | inline int max(int x, int y) { return x>y? x:y; }
    method split (line 93) | inline void split(const string &s, char delim, vector<string> &elems) {
    method split (line 104) | inline vector<string> split(const string &s, char delim) {

FILE: algorithms/cpp/longestSubstringWithAtMostTwoDistinctCharacters/longestSubstringWithAtMostTwoDistinctCharacters.cpp
  function lengthOfLongestSubstringTwoDistinct (line 33) | int lengthOfLongestSubstringTwoDistinct(string s) {
  function main (line 57) | int main(int argc, char** argv)

FILE: algorithms/cpp/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp
  function lengthOfLongestSubstring1 (line 28) | int lengthOfLongestSubstring1(string s) {
  function lengthOfLongestSubstring (line 44) | int lengthOfLongestSubstring(string s) {
  function main (line 63) | int main(int argc, char** argv)

FILE: algorithms/cpp/longestTurbulentSubarray/LongestTurbulentSubarray.cpp
  class Solution (line 39) | class Solution {
    method maxTurbulenceSize_01 (line 42) | int maxTurbulenceSize_01(vector<int>& A) {
    method maxTurbulenceSize_02 (line 113) | int maxTurbulenceSize_02(vector<int>& A) {
    method maxTurbulenceSize (line 134) | int maxTurbulenceSize(vector<int>& A) {

FILE: algorithms/cpp/longestValidParentheses/longestValidParentheses.cpp
  function longestValidParentheses (line 23) | int longestValidParentheses(string s) {
  function main (line 51) | int main(int argc, char** argv)

FILE: algorithms/cpp/lowestCommonAncestorOfABinarySearchTree/LowestCommonAncestorOfABinarySearchTree.cpp
  class Solution (line 39) | class Solution {
    method TreeNode (line 41) | TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* ...

FILE: algorithms/cpp/lowestCommonAncestorOfABinaryTree/LowestCommonAncestorOfABinaryTree.cpp
  class Solution (line 40) | class Solution {
    method findPath (line 42) | bool findPath(TreeNode* root, TreeNode* p, vector<TreeNode*>& path) {
    method TreeNode (line 58) | TreeNode* lowestCommonAncestor01(TreeNode* root, TreeNode* p, TreeNode...
    method TreeNode (line 77) | TreeNode* lowestCommonAncestor02(TreeNode* root, TreeNode* p, TreeNode...
    method TreeNode (line 95) | TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* ...

FILE: algorithms/cpp/majorityElement/majorityElement.II.cpp
  class Solution (line 14) | class Solution {
    method majorityElement01 (line 18) | vector<int> majorityElement01(vector<int>& nums) {
    method majorityElement02 (line 33) | vector<int> majorityElement02(vector<int>& nums) {
    method majorityElement (line 67) | vector<int> majorityElement(vector<int>& nums) {

FILE: algorithms/cpp/majorityElement/majorityElement.cpp
  function majorityElement (line 26) | int majorityElement(vector<int> &num) {
  function split (line 53) | vector<int> split(const string &s, char delim) {
  function main (line 60) | int main(int argc, char** argv)

FILE: algorithms/cpp/makeTheXorOfAllSegmentsEqualToZero/MakeTheXorOfAllSegmentsEqualToZero.cpp
  class Solution (line 66) | class Solution {
    method minChanges (line 68) | int minChanges(vector<int>& nums, int k) {

FILE: algorithms/cpp/mapOfHighestPeak/MapOfHighestPeak.cpp
  class Cell (line 49) | class Cell{
  class Solution (line 56) | class Solution {
    method setHeight (line 58) | void setHeight(vector<vector<int>>& height,
    method highestPeak (line 70) | vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {

FILE: algorithms/cpp/matrixCellsInDistanceOrder/MatrixCellsInDistanceOrder.cpp
  class Solution (line 47) | class Solution {
    method put (line 49) | void put(int R, int C, int r, int c, vector<vector<int>>& res) {
    method allCellsDistOrder (line 54) | vector<vector<int>> allCellsDistOrder(int R, int C, int r0, int c0) {

FILE: algorithms/cpp/maxAreaOfIsland/MaxAreaOfIsland.cpp
  class Solution (line 36) | class Solution {
    method maxAreaOfIsland (line 38) | int maxAreaOfIsland(vector<vector<int>>& grid) {
    method maxAreaOfIsland_DFS (line 52) | void maxAreaOfIsland_DFS( vector<vector<int>>& grid, int i, int j, int...

FILE: algorithms/cpp/maxPointsOnALine/maxPointsOnALine.cpp
  type Point (line 18) | struct Point {
    method Point (line 21) | Point() : x(0), y(0) {}
    method Point (line 22) | Point(int a, int b) : x(a), y(b) {}
  function maxPoints (line 26) | int maxPoints(vector<Point> &points) {
  function generatePoints (line 79) | void generatePoints(vector<Point> &points, int n) {
  function printPoints (line 89) | void printPoints(vector<Point> &points) {
  function main (line 97) | int main(int argc, char** argv)

FILE: algorithms/cpp/maximalRectangle/maximalRectangle.cpp
  function largestRectangleArea (line 30) | int largestRectangleArea(vector<int> &height) {
  function maximalRectangle (line 54) | int maximalRectangle(vector<vector<char> > &matrix) {
  function printArray (line 78) | void printArray(vector<int> &v)
  function test (line 87) | void test(int a[], int n)
  function main (line 94) | int main(int argc, char** argv)

FILE: algorithms/cpp/maximalSquare/MaximalSquare.cpp
  class Solution (line 67) | class Solution {
    method min (line 69) | inline int min(int x, int y) {
    method min (line 72) | inline int min(int x, int y, int z) {
    method maximalSquare (line 75) | int maximalSquare(vector<vector<char>>& matrix) {

FILE: algorithms/cpp/maximizeNumberOfNiceDivisors/MaximizeNumberOfNiceDivisors.cpp
  class Solution (line 73) | class Solution {
    method maxNiceDivisors (line 75) | int maxNiceDivisors(int primeFactors) {
    method maxNiceDivisors_01 (line 81) | int maxNiceDivisors_01(int primeFactors) {
    method maxNiceDivisors_02 (line 91) | int maxNiceDivisors_02(int primeFactors) {
    method pow3 (line 109) | int pow3(int x) {
    method maxNiceDivisors_03 (line 124) | int maxNiceDivisors_03(int primeFactors) {

FILE: algorithms/cpp/maximizePalindromeLengthFromSubsequences/MaximizePalindromeLengthFromSubsequences.cpp
  class Solution (line 72) | class Solution {
    method longestPalindrome (line 75) | int longestPalindrome(string word1, string word2) {

FILE: algorithms/cpp/maximizeScoreAfterNOperations/MaximizeScoreAfterNOperations.cpp
  class Solution (line 48) | class Solution {
    method gcd (line 52) | int gcd(int a, int b) {
    method maxScore (line 61) | int maxScore(vector<int>& nums) {
    method maxScore (line 76) | int maxScore(vector<vector<int>>& pair_gcd, int mask, int n, int step) {

FILE: algorithms/cpp/maximumAbsoluteSumOfAnySubarray/MaximumAbsoluteSumOfAnySubarray.cpp
  class Solution (line 35) | class Solution {
    method maxAbsoluteSum (line 37) | int maxAbsoluteSum(vector<int>& nums) {
    method maxAbsoluteSum01 (line 44) | int maxAbsoluteSum01(vector<int>& nums) {
    method maxSumArray (line 49) | int maxSumArray(vector<int>& nums) {
    method minSumArray (line 60) | int minSumArray(vector<int>& nums) {
    method maxAbsoluteSum02 (line 73) | int maxAbsoluteSum02(vector<int>& nums) {

FILE: algorithms/cpp/maximumAscendingSubarraySum/MaximumAscendingSubarraySum.cpp
  class Solution (line 44) | class Solution {
    method maxAscendingSum (line 46) | int maxAscendingSum(vector<int>& nums) {

FILE: algorithms/cpp/maximumAveragePassRatio/MaximumAveragePassRatio.cpp
  class Solution (line 44) | class Solution {
    method print_queue (line 47) | void print_queue(T q) { // NB: pass by value so the print uses a copy
    method ratio (line 58) | double ratio(double pass, double total) {
    method profit (line 62) | double profit(double pass, double total) {
    method maxAverageRatio (line 67) | double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {

FILE: algorithms/cpp/maximumAverageSubarray/MaximumAverageSubarray.I.cpp
  class Solution (line 28) | class Solution {
    method findMaxAverage (line 30) | double findMaxAverage(vector<int>& nums, int k) {

FILE: algorithms/cpp/maximumBuildingHeight/MaximumBuildingHeight.cpp
  class Solution (line 130) | class Solution {
    method print (line 132) | void print(vector<vector<int>>& vv){
    method getMaxHeight (line 142) | int getMaxHeight(vector<int>& left, vector<int>& right) {
    method maxBuilding (line 162) | int maxBuilding(int n, vector<vector<int>>& restrictions) {

FILE: algorithms/cpp/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.cpp
  class Solution (line 23) | class Solution {
    method maxDepth (line 25) | int maxDepth(TreeNode *root) {
  class Solution2 (line 44) | class Solution2 {
    method maxDepth (line 46) | int maxDepth(TreeNode *root) {

FILE: algorithms/cpp/maximumDistanceBetweenAPairOfValues/MaximumDistanceBetweenAPairOfValues.cpp
  class Solution (line 51) | class Solution {
    method maxDistance (line 53) | int maxDistance(vector<int>& nums1, vector<int>& nums2) {
    method binary_search (line 59) | int binary_search(vector<int>& nums, int start, int target) {
    method maxDistance1 (line 69) | int maxDistance1(vector<int>& nums1, vector<int>& nums2) {
    method maxDistance2 (line 79) | int maxDistance2(vector<int>& nums1, vector<int>& nums2) {

FILE: algorithms/cpp/maximumElementAfterDecreasingAndRearranging/MaximumElementAfterDecreasingAndRearranging.cpp
  class Solution (line 55) | class Solution {
    method maximumElementAfterDecrementingAndRearranging (line 57) | int maximumElementAfterDecrementingAndRearranging(vector<int>& arr) {

FILE: algorithms/cpp/maximumErasureValue/MaximumErasureValue.cpp
  class Solution (line 33) | class Solution {
    method maximumUniqueSubarray (line 35) | int maximumUniqueSubarray(vector<int>& nums) {

FILE: algorithms/cpp/maximumGap/maximumGap.cpp
  function maximumGap (line 23) | int maximumGap(vector<int> &num) {
  function main (line 67) | int main()

FILE: algorithms/cpp/maximumIceCreamBars/MaximumIceCreamBars.cpp
  class Solution (line 44) | class Solution {
    method maxIceCream (line 46) | int maxIceCream(vector<int>& costs, int coins) {

FILE: algorithms/cpp/maximumNumberOfBallsInABox/MaximumNumberOfBallsInABox.cpp
  class Solution (line 50) | class Solution {
    method sum (line 52) | int sum(int n) {
    method countBalls (line 60) | int countBalls(int lowLimit, int highLimit) {

FILE: algorithms/cpp/maximumNumberOfConsecutiveValuesYouCanMake/MaximumNumberOfConsecutiveValuesYouCanMake.cpp
  class Solution (line 52) | class Solution {
    method getMaximumConsecutive (line 54) | int getMaximumConsecutive(vector<int>& coins) {

FILE: algorithms/cpp/maximumNumberOfEventsThatCanBeAttended/MaximumNumberOfEventsThatCanBeAttended.II.cpp
  class Solution (line 47) | class Solution {
    method comp_start (line 49) | static const bool comp_start(vector<int>& x, vector<int>& y) {
    method comp_end (line 53) | static const bool comp_end(vector<int>& x, vector<int>& y) {
    method print (line 57) | void print(vector<vector<int>>& events){
    method maxValue (line 70) | int maxValue(vector<vector<int>>& events, int k) {
    method findNextEvent (line 91) | int findNextEvent(vector<vector<int>>& events, int low, int day) {
    method maxValueDFS (line 105) | int maxValueDFS(vector<vector<int>>& events, int current, int k) {
    method maxValueDFS (line 118) | int maxValueDFS(vector<vector<int>>& events, int current, int k, vecto...
    method findPrevEvent (line 142) | int findPrevEvent(vector<vector<int>>& events, int high, int day) {
    method maxValueDP (line 155) | int maxValueDP(vector<vector<int>>& events, int k) {

FILE: algorithms/cpp/maximumNumberOfEventsThatCanBeAttended/MaximumNumberOfEventsThatCanBeAttended.cpp
  class Solution (line 53) | class Solution {
    method comp_start (line 55) | static const bool comp_start(vector<int>& x, vector<int>& y) {
    method comp_end (line 59) | static const bool comp_end(vector<int>& x, vector<int>& y) {
    method find (line 66) | int find(int x, vector<int>& f) {
    method print (line 73) | void print(vector<vector<int>>& events){
    method maxEvents (line 81) | int maxEvents(vector<vector<int>>& events) {
    method maxEvents_priority_queue (line 86) | int maxEvents_priority_queue(vector<vector<int>>& events) {
    method maxEvents_union_find (line 122) | int maxEvents_union_find(vector<vector<int>>& events) {

FILE: algorithms/cpp/maximumNumberOfGroupsGettingFreshDonuts/MaximumNumberOfGroupsGettingFreshDonuts.cpp
  class Solution (line 38) | class Solution {
    method maxHappyGroups (line 40) | int maxHappyGroups(int batchSize, vector<int>& groups) {
    method dfs (line 71) | int dfs(vector<int>& reminder, int batchSize, int sum, map<vector<int>...

FILE: algorithms/cpp/maximumNumberOfWordsYouCanType/MaximumNumberOfWordsYouCanType.cpp
  class Solution (line 41) | class Solution {
    method canBeTypedWords (line 43) | int canBeTypedWords(string text, string brokenLetters) {

FILE: algorithms/cpp/maximumPopulationYear/MaximumPopulationYear.cpp
  class Solution (line 36) | class Solution {
    method maximumPopulation (line 39) | int maximumPopulation(vector<vector<int>>& logs) {

FILE: algorithms/cpp/maximumProductOfTwoElementsInAnArray/MaximumProductOfTwoElementsInAnArray.cpp
  class Solution (line 34) | class Solution {
    method maxProduct (line 36) | int maxProduct(vector<int>& nums) {

FILE: algorithms/cpp/maximumProductOfWordLengths/MaximumProductOfWordLengths.cpp
  class Solution (line 34) | class Solution {
    method maxProduct (line 46) | int maxProduct(vector<string>& words) {

FILE: algorithms/cpp/maximumProductSubarray/maximumProductSubarray.cpp
  function max (line 30) | int max(int x, int y) {
  function min (line 33) | int min(int x, int y){
  function max (line 36) | int max(int x, int y, int z) {
  function min (line 39) | int min(int x, int y, int z) {
  function maxProduct (line 50) | int maxProduct(int A[], int n) {
  function main (line 73) | int main()

FILE: algorithms/cpp/maximumScoreFromPerformingMultiplicationOperations/MaximumScoreFromPerformingMultiplicationOperations.cpp
  class Solution (line 51) | class Solution {
    method maximumScore (line 56) | int maximumScore(vector<int>& nums, vector<int>& multipliers) {
    method maximumScoreDFS (line 63) | int maximumScoreDFS(vector<int>& nums, int left, int right,

FILE: algorithms/cpp/maximumScoreFromRemovingStones/MaximumScoreFromRemovingStones.cpp
  class Solution (line 55) | class Solution {
    method can_move (line 57) | bool can_move(int a, int b, int c) {
    method swap (line 65) | void swap(int& x, int& y){
    method sort (line 71) | void sort(int& a, int& b, int& c) {
    method maximumScore (line 79) | int maximumScore(int a, int b, int c) {
    method maximumScore_loop (line 83) | int maximumScore_loop(int a, int b, int c) {
    method maximumScore_math (line 95) | int maximumScore_math(int a, int b, int c) {

FILE: algorithms/cpp/maximumScoreFromRemovingSubstrings/MaximumScoreFromRemovingSubstrings.cpp
  class Solution (line 45) | class Solution {
    method maximumGain (line 47) | int maximumGain(string s, int x, int y) {

FILE: algorithms/cpp/maximumScoreOfAGoodSubarray/MaximumScoreOfAGoodSubarray.cpp
  class Solution (line 33) | class Solution {
    method maximumScore (line 35) | int maximumScore(vector<int>& nums, int k) {

FILE: algorithms/cpp/maximumSubArray/maximumSubArray.cpp
  function max (line 30) | int max(int x, int y){
  function maxSubArray (line 34) | int maxSubArray(int A[], int n) {
  function maxSubArray1 (line 41) | int maxSubArray1(int A[], int n) {
  function maxSubArray2 (line 53) | int maxSubArray2(int A[], int n) {
  function main (line 66) | int main()

FILE: algorithms/cpp/maximumSubarrayMinProduct/MaximumSubarrayMinProduct.cpp
  class Solution (line 48) | class Solution {
    method maxSumMinProduct (line 50) | int maxSumMinProduct(vector<int>& nums) {

FILE: algorithms/cpp/maximumUnitsOnATruck/MaximumUnitsOnATruck.cpp
  class Solution (line 42) | class Solution {
    method print (line 44) | void print(vector<vector<int>>& boxes) {
    method maximumUnits (line 53) | int maximumUnits(vector<vector<int>>& boxTypes, int truckSize) {

FILE: algorithms/cpp/maximumValueAfterInsertion/MaximumValueAfterInsertion.cpp
  class Solution (line 40) | class Solution {
    method string (line 42) | string maxValue(string n, int x) {

FILE: algorithms/cpp/maximumValueAtAGivenIndexInABoundedArray/MaximumValueAtAGivenIndexInABoundedArray.cpp
  class Solution (line 83) | class Solution {
    method maxValue (line 85) | int maxValue(int n, int index, int maxSum) {

FILE: algorithms/cpp/maximumXorForEachQuery/MaximumXorForEachQuery.cpp
  class Solution (line 50) | class Solution {
    method getMaximumXor (line 52) | vector<int> getMaximumXor(vector<int>& nums, int maximumBit) {
    method getMaximumXor (line 67) | vector<int> getMaximumXor(vector<int>& nums, int maximumBit) {

FILE: algorithms/cpp/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp
  function binarySearch (line 16) | int binarySearch(int A[], int low, int high, int key){
  function findMedianSortedArrayHelper (line 31) | double findMedianSortedArrayHelper(int A[], int m, int B[], int n, int l...
  function findMedianSortedArrays (line 94) | double findMedianSortedArrays(int A[], int m, int B[], int n) {
  function main (line 114) | int main()

FILE: algorithms/cpp/mergeIntervals/mergeIntervals.cpp
  type Interval (line 21) | struct Interval {
    method Interval (line 24) | Interval() : start(0), end(0) {}
    method Interval (line 25) | Interval(int s, int e) : start(s), end(e) {}
  function compare (line 29) | bool compare(const Interval& lhs, const Interval& rhs){
  function merge (line 33) | vector<Interval> merge(vector<Interval> &intervals) {
  function main (line 55) | int main(int argc, char**argv)

FILE: algorithms/cpp/mergeKSortedLists/mergeKSortedLists.cpp
  type ListNode (line 20) | struct ListNode {
    method ListNode (line 23) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 30) | ListNode *mergeKLists(vector<ListNode *> &lists) {
    method ListNode (line 23) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 53) | ListNode *mergeTwoLists(ListNode* head1, ListNode* head2){
    method ListNode (line 23) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 68) | ListNode *mergeTwoLists01(ListNode* head1, ListNode* head2){
    method ListNode (line 23) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 100) | ListNode *mergeTwoLists02(ListNode* head1, ListNode* head2) {
    method ListNode (line 23) | ListNode(int x) : val(x), next(NULL) {}
  function TakeOutNode (line 125) | void TakeOutNode(ListNode*& head, ListNode*& tail, ListNode*& p){
  function printList (line 137) | void printList(ListNode* h)
  function ListNode (line 146) | ListNode* createList(int a[], int n)
    method ListNode (line 23) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 161) | int main(int argc, char**argv)

FILE: algorithms/cpp/mergeStringsAlternately/MergeStringsAlternately.cpp
  class Solution (line 46) | class Solution {
    method string (line 48) | string mergeAlternately(string word1, string word2) {

FILE: algorithms/cpp/mergeTwoSortedArray/mergeTwoSortedArray.cpp
  function merge (line 18) | void merge(int A[], int m, int B[], int n) {
  function printArray (line 42) | void printArray(int A[], int n) {
  function main (line 50) | int main()

FILE: algorithms/cpp/mergeTwoSortedList/mergeTwoSortedList.cpp
  class Solution (line 20) | class Solution {
    method Solution (line 22) | Solution(){
    method ListNode (line 25) | ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) {
    method ListNode (line 37) | ListNode *mergeTwoLists01(ListNode* head1, ListNode* head2){
    method ListNode (line 64) | ListNode *mergeTwoLists02(ListNode *l1, ListNode *l2) {
    method ListNode (line 92) | ListNode* mergeTheRest(ListNode* l, ListNode*head, ListNode* tail){
    method ListNode (line 109) | ListNode *mergeTwoLists03(ListNode *l1, ListNode *l2) {

FILE: algorithms/cpp/minCostClimbingStairs/MinCostClimbingStairs.cpp
  class Solution (line 32) | class Solution {
    method minCostClimbingStairs (line 34) | int minCostClimbingStairs(vector<int>& cost) {
    method minCostClimbingStairs01 (line 38) | int minCostClimbingStairs01(vector<int>& cost) {
    method minCostClimbingStairs02 (line 48) | int minCostClimbingStairs02(vector<int>& cost) {

FILE: algorithms/cpp/minStack/minStack.cpp
  class Stack (line 26) | class Stack {
    method Stack (line 32) | Stack():_capacity(1),_top(-1){
    method push (line 40) | void push(T x){
    method T (line 52) | T pop() {
    method T (line 56) | T& top(bool pop=false) {
    method empty (line 67) | bool empty(){
    method size (line 70) | int size() {
    method clear (line 73) | void clear(){
  class MinStack (line 99) | class MinStack {
    type minData (line 103) | struct minData{
      method minData (line 106) | minData():min(0), cnt(0) {}
      method minData (line 107) | minData(int m, int c):min(m),cnt(c){}
    method push (line 115) | void push(int x) {
    method pop (line 134) | void pop() {
    method top (line 150) | int top() {
    method getMin (line 154) | int getMin() {
    method clear (line 157) | void clear() {
  function main (line 164) | int main()

FILE: algorithms/cpp/miniParser/MiniParser.cpp
  class Solution (line 69) | class Solution {
    method NestedInteger (line 71) | NestedInteger deserialize(string s) {
    method NestedInteger (line 79) | NestedInteger helper(string& s, int& pos) {
    method NestedInteger (line 97) | NestedInteger atoni(string& s, int& pos) {
    method isnum (line 113) | bool isnum(char& c) {

FILE: algorithms/cpp/minimizeMaximumPairSumInArray/MinimizeMaximumPairSumInArray.cpp
  class Solution (line 42) | class Solution {
    method minPairSum (line 44) | int minPairSum(vector<int>& nums) {

FILE: algorithms/cpp/minimumASCIIDeleteSumForTwoStrings/MinimumAsciiDeleteSumForTwoStrings.cpp
  class Solution (line 32) | class Solution {
    method minimumDeleteSum (line 34) | int minimumDeleteSum(string s1, string s2) {

FILE: algorithms/cpp/minimumAbsoluteSumDifference/MinimumAbsoluteSumDifference.cpp
  class Solution (line 54) | class Solution {
    method minAbsoluteSumDiff (line 56) | int minAbsoluteSumDiff(vector<int>& nums1, vector<int>& nums2) {

FILE: algorithms/cpp/minimumAdjacentSwapsToReachTheKthSmallestNumber/MinimumAdjacentSwapsToReachTheKthSmallestNumber.cpp
  class Solution (line 57) | class Solution {
    method nextPermutation (line 61) | void nextPermutation(string& num) {
    method reverse (line 76) | void reverse(string& num, int start) {
    method getMinSwaps (line 87) | int getMinSwaps(string num, int k) {

FILE: algorithms/cpp/minimumChangesToMakeAlternatingBinaryString/MinimumChangesToMakeAlternatingBinaryString.cpp
  class Solution (line 39) | class Solution {
    method minOperations (line 41) | int minOperations(string s) {

FILE: algorithms/cpp/minimumCostForTickets/MinimumCostForTickets.cpp
  class Solution (line 53) | class Solution {
    method min (line 55) | int min(int x, int y){
    method min (line 58) | int min(int x, int y, int z) {
    method mincostTickets (line 62) | int mincostTickets(vector<int>& days, vector<int>& costs) {

FILE: algorithms/cpp/minimumDegreeOfAConnectedTrioInAGraph/MinimumDegreeOfAConnectedTrioInAGraph.cpp
  class Solution (line 45) | class Solution {
    method has_edge (line 50) | bool has_edge(int x, int y) {
    method node_edges (line 54) | int node_edges(int x){
    method degree (line 58) | int degree(int x, int y, int z) {
    method minTrioDegree (line 66) | int minTrioDegree(int n, vector<vector<int>>& edges) {

FILE: algorithms/cpp/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp
  class Solution (line 23) | class Solution {
    method minDepth (line 25) | int minDepth(TreeNode *root) {

FILE: algorithms/cpp/minimumDistanceToTheTargetElement/MinimumDistanceToTheTargetElement.cpp
  class Solution (line 41) | class Solution {
    method getMinDistance (line 43) | int getMinDistance(vector<int>& nums, int target, int start) {

FILE: algorithms/cpp/minimumElementsToAddToFormAGivenSum/MinimumElementsToAddToFormAGivenSum.cpp
  class Solution (line 34) | class Solution {
    method sum (line 36) | long sum(vector<int>& nums) {
    method minElements (line 43) | int minElements(vector<int>& nums, int limit, int goal) {

FILE: algorithms/cpp/minimumFallingPathSum/MinimumFallingPathSum.cpp
  class Solution (line 31) | class Solution {
    method min (line 33) | int min(int x, int y) {
    method min (line 36) | int min( int x, int y, int z) {
    method minFallingPathSum (line 40) | int minFallingPathSum(vector<vector<int>>& A) {

FILE: algorithms/cpp/minimumHeightTrees/MinimumHeightTrees.cpp
  class Solution (line 64) | class Solution {
    method findMinHeightTrees (line 66) | vector<int> findMinHeightTrees(int n, vector<pair<int, int>>& edges) {

FILE: algorithms/cpp/minimumInsertionsToBalanceAParenthesesString/MinimumInsertionsToBalanceAParenthesesString.cpp
  class Solution (line 60) | class Solution {
    method minInsertions (line 62) | int minInsertions(string s) {

FILE: algorithms/cpp/minimumIntervalToIncludeEachQuery/MinimumIntervalToIncludeEachQuery.cpp
  class Solution (line 47) | class Solution {
    method minInterval (line 49) | vector<int> minInterval(vector<vector<int>>& intervals, vector<int>& q...

FILE: algorithms/cpp/minimumLengthOfStringAfterDeletingSimilarEnds/MinimumLengthOfStringAfterDeletingSimilarEnds.cpp
  class Solution (line 49) | class Solution {
    method minimumLength (line 51) | int minimumLength(string s) {

FILE: algorithms/cpp/minimumLimitOfBallsInABag/MinimumLimitOfBallsInABag.cpp
  class Solution (line 53) | class Solution {
    method minimumSize (line 55) | int minimumSize(vector<int>& nums, int maxOperations) {

FILE: algorithms/cpp/minimumNumberOfOperationsToMoveAllBallsToEachBox/MinimumNumberOfOperationsToMoveAllBallsToEachBox.cpp
  class Solution (line 40) | class Solution {
    method minOperations (line 43) | vector<int> minOperations(string boxes) {
    method minOperations01 (line 50) | void minOperations01(string& boxes, vector<int>& result ) {
    method minOperations02 (line 64) | void minOperations02(string& boxes, vector<int>& result ) {

FILE: algorithms/cpp/minimumNumberOfOperationsToReinitializeAPermutation/MinimumNumberOfOperationsToReinitializeAPermutation.cpp
  class Solution (line 48) | class Solution {
    method check (line 50) | bool check(vector<int>& a) {
    method reinitializePermutation (line 57) | int reinitializePermutation(int n) {

FILE: algorithms/cpp/minimumNumberOfPeopleToTeach/MinimumNumberOfPeopleToTeach.cpp
  class Solution (line 47) | class Solution {
    method hasLang (line 50) | bool hasLang(vector<int>& langlist, int lang){
    method canComm (line 57) | bool canComm(int u, int v, int n, vector<vector<bool>>& langs) {
    method minimumTeachings (line 64) | int minimumTeachings(int n, vector<vector<int>>& languages, vector<vec...

FILE: algorithms/cpp/minimumOperationsToMakeArrayEqual/MinimumOperationsToMakeArrayEqual.cpp
  class Solution (line 36) | class Solution {
    method minOperations (line 38) | int minOperations(int n) {

FILE: algorithms/cpp/minimumOperationsToMakeTheArrayIncreasing/MinimumOperationsToMakeTheArrayIncreasing.cpp
  class Solution (line 42) | class Solution {
    method minOperations (line 44) | int minOperations(vector<int>& nums) {

FILE: algorithms/cpp/minimumPathSum/minimumPathSum.cpp
  function minPathSum (line 30) | int minPathSum(vector<vector<int>>& grid) {
  function main (line 42) | int main()

FILE: algorithms/cpp/minimumSidewayJumps/MinimumSidewayJumps.cpp
  class Solution (line 56) | class Solution {
    method min (line 58) | int min (int x, int y) {
    method min (line 61) | int min(int x, int y, int z) {
    method print (line 64) | void print(vector<vector<int>>& matrix) {
    method minSideJumps (line 80) | int minSideJumps(vector<int>& obstacles) {

FILE: algorithms/cpp/minimumSizeSubarraySum/MinimumSizeSubarraySum.cpp
  class Solution (line 24) | class Solution {
    method minSubArrayLen (line 26) | int minSubArrayLen(int s, vector<int>& nums) {

FILE: algorithms/cpp/minimumSpeedToArriveOnTime/MinimumSpeedToArriveOnTime.cpp
  class Solution (line 62) | class Solution {
    method verify (line 64) | bool verify(vector<int>& dist, double hour, int speed) {
    method minSpeedOnTime (line 74) | int minSpeedOnTime(vector<int>& dist, double hour) {

FILE: algorithms/cpp/minimumWindowSubstring/minimumWindowSubstring.cpp
  function string (line 34) | string minWindow(string s, string t) {
  function main (line 110) | int main(int argc, char**argv)

FILE: algorithms/cpp/mirrorReflection/MirrorReflection.cpp
  class Solution (line 58) | class Solution {
    method greatestCommonDivisor (line 61) | int greatestCommonDivisor (int a, int b) {
    method leastCommonMultiple (line 66) | int leastCommonMultiple(int a, int b) {
    method mirrorReflection (line 70) | int mirrorReflection(int p, int q) {

FILE: algorithms/cpp/missingNumber/MissingNumber.cpp
  class Solution (line 22) | class Solution {
    method missingNumber01 (line 29) | int missingNumber01(vector<int>& nums) {
    method missingNumber02 (line 41) | int missingNumber02(vector<int>& nums) {
    method missingNumber (line 49) | int missingNumber(vector<int>& nums) {

FILE: algorithms/cpp/missingRanges/missingRanges.cpp
  function string (line 25) | string& makeRange(int lo, int hi){
  function findMissingRanges (line 39) | vector<string> findMissingRanges(int A[], int n, int lower, int upper) {
  function printVector (line 67) | void printVector(vector<string> v){
  function string2Array (line 77) | vector<int> string2Array(string s){
  function main (line 94) | int main(int argc, char**argv)

FILE: algorithms/cpp/mostCommonWord/MostCommonWord.cpp
  class Solution (line 50) | class Solution {
    method isLetter (line 52) | bool isLetter(char c) {
    method string (line 56) | string mostCommonWord(string paragraph, vector<string>& banned) {

FILE: algorithms/cpp/moveZeroes/moveZeroes.cpp
  class Solution (line 24) | class Solution {
    method moveZeroes (line 40) | void moveZeroes(vector<int>& nums) {
    method moveZeroes (line 70) | void moveZeroes(vector<int>& nums) {

FILE: algorithms/cpp/multiplyStrings/multiplyStrings.cpp
  function string (line 17) | string multiply(string& num, char ch){
  function string (line 33) | string strPlus(string& num1, string& num2) {
  function string (line 54) | string multiply(string num1, string num2) {
  class Solution (line 78) | class Solution {
    method string (line 81) | string strPlus(string& num1, string& num2) {
    method string (line 108) | string multiply(string num1, string num2) {
  function main (line 137) | int main(int argc, char**argv)

FILE: algorithms/cpp/nQueens/nQueuens.II.cpp
  function totalNQueens (line 25) | int totalNQueens(int n) {
  function solveNQueensRecursive (line 35) | void solveNQueensRecursive(int n, int currentRow, vector<int>& solution,...
  function isValid (line 50) | bool isValid(int attemptedColumn, int attemptedRow, vector<int> &queenIn...
  function main (line 63) | int main(int argc, char** argv)

FILE: algorithms/cpp/nQueens/nQueuens.cpp
  function solveNQueens (line 44) | vector< vector<string> > solveNQueens(int n) {
  function solveNQueensRecursive (line 56) | void solveNQueensRecursive(int n, int currentRow, vector<int>& solution,...
  function isValid (line 84) | bool isValid(int attemptedColumn, int attemptedRow, vector<int> &queenIn...
  function printMatrix (line 99) | void printMatrix(vector< vector<string> >& matrix ){
  function main (line 109) | int main(int argc, char** argv)

FILE: algorithms/cpp/nRepeatedElementInSize2NArray/N-Repeated-Element-in-Size-2N-Array.cpp
  class Solution (line 33) | class Solution {
    method repeatedNTimes (line 35) | int repeatedNTimes(vector<int>& A) {

FILE: algorithms/cpp/nextPermutation/nextPermutation.cpp
  function nextPermutation (line 73) | void nextPermutation(vector<int> &num) {
  function printVector (line 103) | void printVector(vector<int> &num) {
  function isBeginVector (line 109) | bool isBeginVector(vector<int> &num) {
  function main (line 118) | int main(int argc, char** argv)

FILE: algorithms/cpp/nimGame/nimGame.cpp
  class Solution (line 67) | class Solution {
    method canWinNim (line 69) | bool canWinNim(int n) {

FILE: algorithms/cpp/nthDigit/NthDigit.cpp
  class Solution (line 38) | class Solution {
    method findNthDigit (line 40) | int findNthDigit(int n) {

FILE: algorithms/cpp/numberOf1Bits/numberOf1Bits.cpp
  class Solution (line 17) | class Solution {
    method hammingWeight (line 19) | int hammingWeight(uint32_t n) {

FILE: algorithms/cpp/numberOfDifferentIntegersInAString/NumberOfDifferentIntegersInAString.cpp
  class Solution (line 43) | class Solution {
    method isNumber (line 45) | bool isNumber(char ch) {
    method numDifferentIntegers (line 50) | int numDifferentIntegers(string word) {

FILE: algorithms/cpp/numberOfDifferentSubsequencesGcds/NumberOfDifferentSubsequencesGcds.cpp
  class Solution (line 39) | class Solution {
    method gcd (line 43) | int gcd(int a, int b) {
    method countDifferentSubsequenceGCDs (line 53) | int countDifferentSubsequenceGCDs(vector<int>& nums) {

FILE: algorithms/cpp/numberOfDigitOne/NumberOfDigitOne.cpp
  class Solution (line 51) | class Solution {
    method countDigitOne (line 54) | int countDigitOne(int n) {

FILE: algorithms/cpp/numberOfGoodWaysToSplitAString/NumberOfGoodWaysToSplitAString.cpp
  class Solution (line 47) | class Solution {
    method numSplits (line 49) | int numSplits(string s) {

FILE: algorithms/cpp/numberOfIslands/NumberOfIslands.cpp
  function mark (line 33) | void mark(vector<vector<char> >& grid, int r, int c){
  function numIslands (line 48) | int numIslands(vector<vector<char> >& grid) {
  function initGrid (line 61) | void initGrid( string g[], int len, vector<vector<char> >& grid )
  function main (line 68) | int main(void)

FILE: algorithms/cpp/numberOfOrdersInTheBacklog/NumberOfOrdersInTheBacklog.cpp
  class Order (line 76) | class Order {
  type COMP (line 82) | enum COMP { GREATER, LESS }
  class OrderComp (line 85) | class OrderComp {
  class Solution (line 96) | class Solution {
    method processOrder (line 99) | void processOrder(T1& q1, T2& q2, COMP op, int price, int amount, stri...
    method countQ (line 128) | void countQ(T& q, int& amount){
    method getNumberOfBacklogOrders (line 135) | int getNumberOfBacklogOrders(vector<vector<int>>& orders) {

FILE: algorithms/cpp/numberOfRecentCalls/NumberOfRecentCalls.cpp
  class RecentCounter (line 30) | class RecentCounter {
    method RecentCounter (line 32) | RecentCounter() {
    method ping (line 36) | int ping(int t) {
    method binary_search (line 42) | int binary_search(int x) {

FILE: algorithms/cpp/numberOfRectanglesThatCanFormTheLargestSquare/NumberOfRectanglesThatCanFormTheLargestSquare.cpp
  class Solution (line 38) | class Solution {
    method countGoodRectangles (line 40) | int countGoodRectangles(vector<vector<int>>& rectangles) {
    method countGoodRectangles1 (line 45) | int countGoodRectangles1(vector<vector<int>>& rectangles) {
    method countGoodRectangles2 (line 59) | int countGoodRectangles2(vector<vector<int>>& rectangles) {

FILE: algorithms/cpp/numberOfRestrictedPathsFromFirstToLastNode/NumberOfRestrictedPathsFromFirstToLastNode.cpp
  class Solution (line 51) | class Solution {
    method printVector (line 52) | void printVector(vector<int>& v) {
    method countRestrictedPaths (line 60) | int countRestrictedPaths(int n, vector<vector<int>>& edges) {

FILE: algorithms/cpp/numberOfStudentsUnableToEatLunch/NumberOfStudentsUnableToEatLunch.cpp
  class Solution (line 60) | class Solution {
    method countStudents (line 62) | int countStudents(vector<int>& students, vector<int>& sandwiches) {

FILE: algorithms/cpp/numberOfSubArraysWithOddSum/NumberOfSubArraysWithOddSum.cpp
  class Solution (line 48) | class Solution {
    method numOfSubarrays (line 50) | int numOfSubarrays(vector<int>& arr) {

FILE: algorithms/cpp/numberOfSubstringsWithOnly1s/NumberOfSubstringsWithOnly1s.cpp
  class Solution (line 45) | class Solution {
    method numSub (line 53) | int numSub(string s) {

FILE: algorithms/cpp/oddEvenLinkedList/OddEvenLinkedList.cpp
  class Solution (line 34) | class Solution {
    method ListNode (line 36) | ListNode* oddEvenList(ListNode* head) {

FILE: algorithms/cpp/oneEditDistance/oneEditDistance.cpp
  function isOneEditDistance (line 30) | bool isOneEditDistance(string s, string t) {
  function main (line 77) | int main(int argc, char** argv)

FILE: algorithms/cpp/palindromeLinkedList/PalindromeLinkedList.cpp
  class Solution (line 22) | class Solution {
    method ListNode (line 24) | ListNode* findMiddle(ListNode* head) {
    method ListNode (line 33) | ListNode* reverseLink(ListNode* head) {
    method isPalindrome (line 45) | bool isPalindrome(ListNode* head) {

FILE: algorithms/cpp/palindromeNumber/palindromeNumber.cpp
  class Solution (line 26) | class Solution {
    method isPalindrome (line 29) | bool isPalindrome(int x) {
    method isPalindrome1 (line 34) | bool isPalindrome1(int x) {
    method isPalindrome2 (line 56) | bool isPalindrome2(int x) {
    method reverse (line 61) | int reverse(int x) {
  function main (line 79) | int main()

FILE: algorithms/cpp/palindromePairs/PalindromePairs.cpp
  class Solution (line 26) | class Solution {
    method isPalindrome (line 28) | bool isPalindrome(string& str) {
    method palindromePairs (line 35) | vector<vector<int>> palindromePairs(vector<string>& words) {

FILE: algorithms/cpp/palindromePartitioning/palindromePartitioning.II.cpp
  function minCut (line 28) | int minCut(string s) {
  function minCut_DP (line 85) | int minCut_DP(string& s) {
  function minCutHelper (line 129) | int minCutHelper(string &s, int steps, int& minSteps ) {
  function minCutHelper (line 178) | void minCutHelper(string &s, int start, int steps, int& min ) {
  function isPalindrome (line 197) | bool isPalindrome(string &s, int start, int end)  {
  function main (line 214) | int main(int argc, char** argv)

FILE: algorithms/cpp/palindromePartitioning/palindromePartitioning.cpp
  function isPalindrome (line 29) | bool isPalindrome(string &s, int start, int end)  {
  function partitionHelper (line 69) | void partitionHelper(string &s, int start, vector<string> &output, vecto...
  function partition (line 87) | vector< vector<string> > partition(string s) {
  function printMatrix (line 98) | void printMatrix(vector< vector<string> > &matrix)
  function main (line 111) | int main(int argc, char** argv)

FILE: algorithms/cpp/palindromicSubstrings/PalindromicSubstrings.cpp
  class Solution (line 30) | class Solution {
    method countSubstrings (line 32) | int countSubstrings(string s) {

FILE: algorithms/cpp/partitionEqualSubsetSum/PartitionEqualSubsetSum.cpp
  class Solution (line 38) | class Solution {
    method canPartitionRecrusion (line 41) | bool canPartitionRecrusion(vector<int>& nums, int half, int index) {
    method canPartition (line 52) | bool canPartition(vector<int>& nums) {

FILE: algorithms/cpp/partitionList/partitionList.cpp
  type ListNode (line 21) | struct ListNode {
    method ListNode (line 24) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 27) | ListNode *partition(ListNode *head, int x) {
    method ListNode (line 24) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 53) | void printList(ListNode* h)
  function ListNode (line 62) | ListNode* createList(int a[], int n)
    method ListNode (line 24) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 76) | int main()

FILE: algorithms/cpp/pascalTriangle/pascalTriangle.II.cpp
  function getRow (line 23) | vector<int> getRow(int rowIndex) {
  function printVector (line 36) | void printVector( vector<int>  pt)
  function main (line 45) | int main(int argc, char** argv)

FILE: algorithms/cpp/pascalTriangle/pascalTriangle.cpp
  function generate (line 28) | vector<vector<int> > generate(int numRows)
  function printTriangle (line 47) | void printTriangle(vector< vector<int> > pt)
  function main (line 70) | int main(int argc, char** argv)

FILE: algorithms/cpp/patchingArray/PatchingArray.cpp
  class Solution (line 35) | class Solution {
    method minPatches (line 37) | int minPatches(vector<int>& nums, int n) {
    method minPatches_01 (line 66) | int minPatches_01(vector<int>& nums, int n) {
    method minPatches_02 (line 100) | int minPatches_02(vector<int>& nums, int n) {

FILE: algorithms/cpp/pathSum/pathSum.II.cpp
  class Solution (line 39) | class Solution {
    method pathSum (line 41) | vector<vector<int> > pathSum(TreeNode *root, int sum) {
    method generatePathSum (line 48) | void generatePathSum(TreeNode *root, int sum, int s, vector<int> v, ve...

FILE: algorithms/cpp/pathSum/pathSum.cpp
  class Solution (line 36) | class Solution {
    method Solution (line 38) | Solution(){
    method hasPathSum (line 41) | bool hasPathSum(TreeNode *root, int sum) {
    method hasPathSum3 (line 47) | bool hasPathSum3(TreeNode* root, int sum, int s) {
    method hasPathSum1 (line 54) | bool hasPathSum1(TreeNode *root, int sum) {
    method hasPathSum2 (line 79) | bool hasPathSum2(TreeNode *root, int sum) {

FILE: algorithms/cpp/peakIndexInAMountainArray/PeakIndexInAMountainArray.cpp
  class Solution (line 42) | class Solution {
    method peakIndexInMountainArray (line 44) | int peakIndexInMountainArray(vector<int>& A) {

FILE: algorithms/cpp/peekingIterator/PeekingIterator.cpp
  class Iterator (line 37) | class Iterator {
    type Data (line 38) | struct Data
  class PeekingIterator (line 51) | class PeekingIterator : public Iterator {
    method takeNext (line 56) | void takeNext() {
    method PeekingIterator (line 63) | PeekingIterator(const vector<int>& nums) : Iterator(nums) {
    method peek (line 71) | int peek() {
    method next (line 77) | int next() {
    method hasNext (line 84) | bool hasNext() const {

FILE: algorithms/cpp/perfectRectangle/PerfectRectangle.cpp
  class Solution (line 61) | class Solution {
    method isRectangleCover (line 63) | bool isRectangleCover(vector<vector<int>>& rectangles) {

FILE: algorithms/cpp/perfectSquares/PerfectSquares.cpp
  class Solution (line 19) | class Solution {
    method numSquares (line 22) | int numSquares(int n) {
    method numSquares_dp (line 62) | int numSquares_dp(int n) {
    method numSquares_dp_opt (line 81) | int numSquares_dp_opt(int n) {

FILE: algorithms/cpp/permutationSequence/permutationSequence.cpp
  function string (line 46) | string getPermutation(int n, int k) {
  function string (line 83) | string getPermutation_0(int n, int k) {
  function string (line 116) | string getPermutation_1(int n, int k) {
  function nextPermutation (line 137) | void nextPermutation(vector<int>& num) {
  function main (line 158) | int main(int argc, char**argv)

FILE: algorithms/cpp/permutations/permutations.II.cpp
  function permute (line 27) | vector<vector<int> > permute(vector<int> &num) {
  function printVector (line 60) | void printVector( vector<int>&  pt)
  function main (line 70) | int main(int argc, char** argv)

FILE: algorithms/cpp/permutations/permutations.cpp
  function permute (line 62) | vector<vector<int> > permute(vector<int> &num) {
  function main (line 89) | int main(int argc, char** argv)

FILE: algorithms/cpp/plusOne/plusOne.cpp
  function plusOne (line 17) | vector<int> plusOne(vector<int> &digits) {
  function printVector (line 34) | void printVector(vector<int>& v)
  function main (line 44) | int main()

FILE: algorithms/cpp/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.II.cpp
  type TreeLinkNode (line 41) | struct TreeLinkNode {
    method TreeLinkNode (line 44) | TreeLinkNode(int x) : val(x), left(NULL), right(NULL), next(NULL) {}
    method TreeLinkNode (line 45) | TreeLinkNode() : val(0), left(NULL), right(NULL), next(NULL) {}
  function connect (line 47) | void connect(TreeLinkNode *root) {
  function connect1 (line 77) | void connect1(TreeLinkNode *root) {
  function connect3 (line 126) | void connect3(TreeLinkNode *root) {
  function connect4 (line 157) | void connect4(TreeLinkNode *root) {
  function printTree (line 191) | void printTree(TreeLinkNode *root){
  function main (line 207) | int main()

FILE: algorithms/cpp/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp
  type TreeLinkNode (line 53) | struct TreeLinkNode {
    method TreeLinkNode (line 56) | TreeLinkNode(int x) : val(x), left(NULL), right(NULL), next(NULL) {}
    method TreeLinkNode (line 57) | TreeLinkNode() : val(0), left(NULL), right(NULL), next(NULL) {}
  function connect (line 61) | void connect(TreeLinkNode *root) {
  function connect1 (line 77) | void connect1(TreeLinkNode *root) {
  function connect2 (line 107) | void connect2(TreeLinkNode *root) {
  function connect3 (line 134) | void connect3(TreeLinkNode *root) {
  function connect4 (line 165) | void connect4(TreeLinkNode *root) {
  function printTree (line 199) | void printTree(TreeLinkNode *root){
  function main (line 214) | int main()

FILE: algorithms/cpp/pow/pow.cpp
  function pow (line 39) | double pow(double x, int n) {
  function main (line 60) | int main(int argc, char** argv){

FILE: algorithms/cpp/powerOfFour/PowerOfFour.cpp
  class Solution (line 21) | class Solution {
    method isPowerOfFour (line 23) | bool isPowerOfFour(int num) {

FILE: algorithms/cpp/powerOfThree/PowerOfThree.cpp
  class Solution (line 17) | class Solution {
    method isPowerOfThree (line 21) | bool isPowerOfThree(int n) {
    method isPowerOfThree03 (line 29) | bool isPowerOfThree03(int n) {
    method isPowerOfThree02 (line 33) | bool isPowerOfThree02(int n) {
    method init (line 37) | void init(unordered_map<int, bool>& power ){
    method isPowerOfThree01 (line 47) | bool isPowerOfThree01(int n) {
    method isPowerOfThree_loop (line 53) | bool isPowerOfThree_loop(int n) {
    method isPowerOfThree_recursive (line 61) | bool isPowerOfThree_recursive(int n) {

FILE: algorithms/cpp/powerOfTwo/PowerOfTwo.cpp
  class Solution (line 17) | class Solution {
    method isPowerOfTwo01 (line 21) | bool isPowerOfTwo01(int n) {
    method isPowerOfTwo02 (line 34) | bool isPowerOfTwo02(int n) {
    method isPowerOfTwo (line 38) | bool isPowerOfTwo(int n) {

FILE: algorithms/cpp/processTasksUsingServers/ProcessTasksUsingServers.cpp
  class Solution (line 62) | class Solution {
    method print (line 65) | void print(T  q) {
    method assignTasks (line 76) | vector<int> assignTasks(vector<int>& servers, vector<int>& tasks) {

FILE: algorithms/cpp/productOfArrayExceptSelf/ProductOfArrayExceptSelf.cpp
  class Solution (line 20) | class Solution {
    method productExceptSelf (line 22) | vector<int> productExceptSelf(vector<int>& nums) {

FILE: algorithms/cpp/queriesOnNumberOfPointsInsideACircle/QueriesOnNumberOfPointsInsideACircle.cpp
  class Solution (line 46) | class Solution {
    method inCircle (line 49) | bool inCircle( vector<int>& point,  vector<int>& circle ) {
    method countPoints (line 61) | vector<int> countPoints(vector<vector<int>>& points, vector<vector<int...

FILE: algorithms/cpp/queueReconstructionByHeight/QueueReconstructionByHeight.cpp
  class Solution (line 24) | class Solution {
    method reconstructQueue (line 27) | vector<pair<int, int>> reconstructQueue(vector<pair<int, int>>& people) {

FILE: algorithms/cpp/randomPickIndex/RandomPickIndex.cpp
  class Solution (line 28) | class Solution {
    method Solution (line 32) | Solution(vector<int> nums) {
    method pick (line 37) | int pick(int target) {

FILE: algorithms/cpp/randomPointInNonOverlappingRectangles/randomPointInNonOverlappingRectangles.cpp
  class Solution (line 43) | class Solution {
    method Solution (line 49) | Solution(vector<vector<int>>& rects) {
    method pick (line 57) | vector<int> pick() {

FILE: algorithms/cpp/rangeSumQuery-Immutable/rangeSumQuery-Immutable.cpp
  class NumArray (line 22) | class NumArray {
    method NumArray (line 38) | NumArray(vector<int> &nums): size(nums.size()), sums(size+1, 0) {
    method sumRange (line 43) | int sumRange(int i, int j) {

FILE: algorithms/cpp/rangeSumQuery-Immutable/rangeSumQuery-Mutable/RangeSumQueryMutable.cpp
  class NumArray (line 34) | class NumArray {
    method NumArray (line 40) | NumArray(vector<int> &nums)  {
    method update (line 49) | void update(int i, int val) {
    method sumRange (line 57) | int sumRange(int i, int j) {
    method sumRange (line 61) | int sumRange(int i) {

FILE: algorithms/cpp/rangeSumQuery2D-Immutable/RangeSumQuery2dImmutable.cpp
  class NumMatrix (line 78) | class NumMatrix {
    method NumMatrix (line 83) | NumMatrix(vector<vector<int>> &matrix) {
    method sumRegion (line 94) | int sumRegion(int row1, int col1, int row2, int col2) {

FILE: algorithms/cpp/ransomNote/RansomNote.cpp
  class Solution (line 24) | class Solution {
    method canConstruct (line 26) | bool canConstruct(string ransomNote, string magazine) {

FILE: algorithms/cpp/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp
  function read4 (line 31) | int read4(char *buf) {
  class RingBuffer (line 42) | class RingBuffer {
    method RingBuffer (line 45) | RingBuffer(int cap=4): _capacity(cap) {
    method read (line 55) | int read(char* buf, int n){
    method write (line 69) | int write(char* buf, int n) {
  class Solution (line 94) | class Solution {
    method read (line 101) | int read(char *buf, int n) {
    method read1 (line 120) | int read1(char *buf, int n) {
  function main (line 148) | int main()

FILE: algorithms/cpp/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp
  class Solution (line 24) | class Solution {
    method read (line 31) | int read(char *buf, int n) {
    method read1 (line 40) | int read1(char *buf, int n) {
    method read2 (line 54) | int read2(char *buf, int n) {

FILE: algorithms/cpp/reconstructItinerary/ReconstructItinerary.cpp
  class Solution (line 56) | class Solution {
    method travel (line 59) | void travel(string& start, unordered_map<string, multiset<string>>& ma...
    method findItinerary (line 68) | vector<string> findItinerary(vector<pair<string, string>> tickets) {

FILE: algorithms/cpp/recoverATreeFromPreorderTraversal/recoverATreeFromPreorderTraversal.cpp
  class Solution (line 49) | class Solution {
    method TreeNode (line 52) | TreeNode* recoverFromPreorder(string S) {

FILE: algorithms/cpp/recoverBinarySearchTree/recoverBinarySearchTree.cpp
  class Solution (line 62) | class Solution {
    method recoverTreeHelper (line 64) | void recoverTreeHelper(TreeNode *root) {
    method recoverTree (line 81) | void recoverTree(TreeNode *root) {

FILE: algorithms/cpp/rectangleArea/RectangleArea.cpp
  type leetcode (line 40) | namespace leetcode
    class Point (line 42) | class Point {
      method Point (line 44) | Point(int _x, int _y):x(_x),y(_y) {}
    class Rectangle (line 48) | class Rectangle {
      method Rectangle (line 50) | Rectangle(int a, int b, int c, int d):topLeft(a,d), bottomRight(c,b)...
      method Area (line 51) | int Area(){
      method InclusiveArea (line 55) | int InclusiveArea (Rectangle &r){
      method OverlappedArea (line 70) | int OverlappedArea(Rectangle &r) {
  function computeArea (line 82) | int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
  function main (line 93) | int main()

FILE: algorithms/cpp/reformatPhoneNumber/ReformatPhoneNumber.cpp
  class Solution (line 70) | class Solution {
    method string (line 72) | string reformatNumber(string number) {

FILE: algorithms/cpp/regularExpressionMatching/regularExpressionMatching.cpp
  function isMatch (line 36) | bool isMatch(const char *s, const char *p) {
  function main (line 60) | int main(int argc, char** argv)

FILE: algorithms/cpp/removeDuplicateLetters/RemoveDuplicateLetters.cpp
  class Solution (line 24) | class Solution {
    method string (line 26) | string removeDuplicateLetters(string s) {

FILE: algorithms/cpp/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp
  function removeDuplicates (line 21) | int removeDuplicates(int A[], int n) {
  function printfArray (line 40) | void printfArray(int A[], int n) {
  function testSuite (line 49) | void testSuite(int a[], int n){
  function main (line 57) | int main()

FILE: algorithms/cpp/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.cpp
  class Solution (line 20) | class Solution {
    method removeDuplicates (line 22) | int removeDuplicates(int A[], int n) {

FILE: algorithms/cpp/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.II.cpp
  type ListNode (line 19) | struct ListNode {
    method ListNode (line 22) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 25) | ListNode *deleteDuplicates(ListNode *head) {
    method ListNode (line 22) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 53) | void printList(ListNode* h)
  function ListNode (line 62) | ListNode* createList(int a[], int n)
    method ListNode (line 22) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 77) | int main()

FILE: algorithms/cpp/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp
  type ListNode (line 18) | struct ListNode {
    method ListNode (line 21) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 24) | ListNode *deleteDuplicates(ListNode *head) {
    method ListNode (line 21) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 36) | void printList(ListNode* h)
  function ListNode (line 45) | ListNode* createList(int a[], int n)
    method ListNode (line 21) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 60) | int main()

FILE: algorithms/cpp/removeElement/removeElement.cpp
  class Solution (line 14) | class Solution {
    method removeElement (line 16) | int removeElement(vector<int>& nums, int val) {
    method removeElement (line 26) | int removeElement(int A[], int n, int elem) {

FILE: algorithms/cpp/removeInvalidParentheses/RemoveInvalidParentheses.cpp
  function removeInvalidParenthesesHelper (line 30) | void removeInvalidParenthesesHelper(string& s, int index, int pair,
  function removeInvalidParentheses (line 74) | vector<string> removeInvalidParentheses(string s) {
  function printVector (line 96) | void printVector(vector<string> result) {
  function main (line 103) | int main(int argc, char** argv) {

FILE: algorithms/cpp/removeKDigits/RemoveKDigits.cpp
  class Solution (line 37) | class Solution {
    method string (line 39) | string removeKdigits_pick(string& num, int k) {
    method string (line 64) | string removeKdigits_remove(string& num, int k) {
    method string (line 99) | string removeKdigits(string num, int k) {

FILE: algorithms/cpp/removeLinkedListElements/RemoveLinkedListElements.cpp
  class Solution (line 25) | class Solution {
    method ListNode (line 27) | ListNode* removeElements(ListNode* head, int val) {

FILE: algorithms/cpp/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp
  class Solution (line 30) | class Solution {
    method ListNode (line 32) | ListNode *removeNthFromEnd(ListNode *head, int n) {

FILE: algorithms/cpp/reorderList/reorderList.cpp
  class ListNode (line 23) | class ListNode {
    method ListNode (line 27) | ListNode():val(0), next(NULL) {}
    method ListNode (line 28) | ListNode(int x) : val(x), next(NULL) {}
  class Solution (line 31) | class Solution {
    method reorderList (line 33) | void reorderList(ListNode *head) {
    method ListNode (line 40) | ListNode* findMidPos(ListNode *head){
    method ListNode (line 58) | ListNode* reverseList(ListNode *head){
    method ListNode (line 70) | ListNode* Merge(ListNode *h1, ListNode* h2) {
  function printList (line 89) | void printList(ListNode *h){
  function main (line 97) | int main(int argc, char** argv)

FILE: algorithms/cpp/repeatedDNASequences/repeatedDNASequences.cpp
  function ACGT2Int (line 34) | int ACGT2Int(char ch){
  function DNASeqs2Int (line 43) | int DNASeqs2Int(string &s, int begin){
  function findRepeatedDnaSequences_01 (line 51) | vector<string> findRepeatedDnaSequences_01(string s) {
  function findRepeatedDnaSequences_02 (line 68) | vector<string> findRepeatedDnaSequences_02(string s) {
  function findRepeatedDnaSequences (line 86) | vector<string> findRepeatedDnaSequences(string s) {
  function printVector (line 94) | void printVector( vector<string> v ) {
  function main (line 102) | int main(int argc, char** argv)

FILE: algorithms/cpp/replaceAllDigitsWithCharacters/ReplaceAllDigitsWithCharacters.cpp
  class Solution (line 46) | class Solution {
    method string (line 48) | string replaceDigits(string s) {

FILE: algorithms/cpp/restoreIPAddresses/restoreIPAddresses.cpp
  function restoreIpAddresses (line 25) | vector<string> restoreIpAddresses(string s) {
  function restoreIpAddressesHelper (line 32) | void restoreIpAddressesHelper(string& s, int start, int partNum, string ...
  function main (line 61) | int main(int argc, char**argv)

FILE: algorithms/cpp/restoreTheArrayFromAdjacentPairs/RestoreTheArrayFromAdjacentPairs.cpp
  class Solution (line 48) | class Solution {
    method restoreArray (line 50) | vector<int> restoreArray(vector<vector<int>>& adjacentPairs) {

FILE: algorithms/cpp/reverseBits/reverseBits.cpp
  class Solution (line 23) | class Solution {
    method reverseBits (line 25) | uint32_t reverseBits(uint32_t n) {

FILE: algorithms/cpp/reverseInteger/reverseInteger.cpp
  function reverse (line 36) | int reverse(int x) {
  function main (line 54) | int main(int argc, char**argv)

FILE: algorithms/cpp/reverseLinkedList/reverseLinkedList.II.cpp
  type ListNode (line 25) | struct ListNode {
    method ListNode (line 28) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 32) | ListNode *reverseBetween(ListNode *head, int m, int n) {
    method ListNode (line 28) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 72) | void printList(ListNode* h)
  function ListNode (line 81) | ListNode* createList(int *a, int n)
    method ListNode (line 28) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 95) | ListNode* createList(int len) {
    method ListNode (line 28) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 105) | int main(int argc, char** argv)

FILE: algorithms/cpp/reverseLinkedList/reverseLinkedList.cpp
  class Solution (line 26) | class Solution {
    method ListNode (line 28) | ListNode* reverseList_iteratively(ListNode* head) {
    method ListNode (line 38) | ListNode* reverseList_recursively(ListNode* head) {
    method ListNode (line 46) | ListNode* reverseList(ListNode* head) {

FILE: algorithms/cpp/reverseNodesInKGroup/reverseNodesInKGroup.cpp
  type ListNode (line 30) | struct ListNode {
    method ListNode (line 33) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 38) | ListNode *reverseKGroup(ListNode *head, int k) {
    method ListNode (line 33) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 55) | ListNode *reverseList(ListNode *&head, int k){
    method ListNode (line 33) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 73) | void printList(ListNode* h)
  function ListNode (line 82) | ListNode* createList(int a[], int n)
    method ListNode (line 33) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 97) | int main(int argc, char** argv)

FILE: algorithms/cpp/reverseString/ReverseString.cpp
  class Solution (line 13) | class Solution {
    method string (line 15) | string reverseString(string s) {

FILE: algorithms/cpp/reverseVowelsOfAString/reverseVowelsOfAString.cpp
  class Solution (line 19) | class Solution {
    method string (line 21) | string reverseVowels(string s) {
    method Solution (line 63) | Solution(){
    method isVowels (line 77) | bool isVowels(char ch) {
    method string (line 80) | string reverseVowels(string s) {
  class Solution (line 59) | class Solution {
    method string (line 21) | string reverseVowels(string s) {
    method Solution (line 63) | Solution(){
    method isVowels (line 77) | bool isVowels(char ch) {
    method string (line 80) | string reverseVowels(string s) {

FILE: algorithms/cpp/reverseWordsInAString/reverseWordsInAString.II.cpp
  function swap (line 26) | void swap(char &a, char &b) {
  function reverse (line 31) | void reverse(string &s, int begin, int end) {
  function reverseWords (line 36) | void reverseWords(string &s) {
  function main (line 53) | int main(int argc, char** argv)

FILE: algorithms/cpp/reverseWordsInAString/reverseWordsInAString.cpp
  function reverseWords (line 36) | void reverseWords(string &s) {
  function reverseWords2 (line 80) | void reverseWords2(string &s) {
  function reverse (line 109) | void reverse(char *b, char *e) {
  function reverseWords (line 117) | void reverseWords(char *s) {
  function test (line 140) | void test() {
  function main (line 154) | main()

FILE: algorithms/cpp/romanToInteger/romanToInteger.cpp
  function romanCharToInt (line 17) | int romanCharToInt(char ch){
  function romanToInt (line 44) | int romanToInt(string s) {
  function main (line 60) | int main(int argc, char**argv)

FILE: algorithms/cpp/rotateArray/rotateArray.cpp
  function reverseArray (line 28) | void reverseArray(int nums[],int start, int end){
  function rotate1 (line 43) | void rotate1(int nums[], int n, int k) {
  function rotate2 (line 60) | void rotate2(int nums[], int n, int k) {
  function rotate (line 85) | void rotate(int nums[], int n, int k) {
  function printArray (line 94) | void printArray(int nums[], int n) {
  function initArray (line 102) | void initArray(int nums[], int n) {
  function main (line 109) | int main(int argc, char**argv) {

FILE: algorithms/cpp/rotateFunction/RotateFunction.cpp
  class Solution (line 55) | class Solution {
    method maxRotateFunction (line 57) | int maxRotateFunction(vector<int>& A) {

FILE: algorithms/cpp/rotateImage/rotateImage.cpp
  function rotate (line 20) | void rotate(vector<vector<int> > &matrix) {
  function printMatrix (line 41) | void printMatrix(vector<vector<int> > &matrix)
  function main (line 53) | int main(int argc, char** argv)

FILE: algorithms/cpp/rotateList/rotateList.cpp
  class Solution (line 23) | class Solution {
    method ListNode (line 25) | ListNode *rotateRight(ListNode *head, int k) {

FILE: algorithms/cpp/rotatingTheBox/RotatingTheBox.cpp
  class Solution (line 60) | class Solution {
    method rotate (line 62) | void rotate(vector<vector<char>>& src, vector<vector<char>>& dest) {
    method gravity (line 70) | void gravity(vector<vector<char>>& box) {
    method rotateTheBox (line 87) | vector<vector<char>> rotateTheBox(vector<vector<char>>& box) {

FILE: algorithms/cpp/sameTree/sameTree.cpp
  class Solution (line 23) | class Solution {
    method Solution (line 25) | Solution(){
    method isSameTree (line 28) | bool isSameTree(TreeNode *p, TreeNode *q) {
    method isSameTree1 (line 35) | bool isSameTree1(TreeNode *p, TreeNode *q) {
    method isSameTree2 (line 43) | bool isSameTree2(TreeNode *p, TreeNode *q) {

FILE: algorithms/cpp/satisfiabilityOfEqualityEquations/SatisfiabilityOfEqualityEquations.cpp
  class Solution (line 53) | class Solution {
    method init (line 56) | void init() {
    method Solution (line 62) | Solution() {
    method find (line 69) | char find(char ch) {
    method join (line 77) | void join(char x, char y) {
    method equationsPossible (line 85) | bool equationsPossible(vector<string>& equations) {

FILE: algorithms/cpp/scrambleString/scrambleString.cpp
  function isScramble_recursion (line 66) | bool isScramble_recursion(string s1, string s2) {
  function isScramble_dp (line 120) | bool isScramble_dp(string s1, string s2) {
  function isScramble (line 158) | bool isScramble(string s1, string s2) {
  function main (line 170) | int main(int argc, char** argv)

FILE: algorithms/cpp/search2DMatrix/search2DMatrix.II.cpp
  class Solution (line 34) | class Solution {
    method binary_search (line 37) | bool binary_search(vector<int> &v, int target) {
    method searchMatrix01 (line 55) | bool searchMatrix01(vector<vector<int>>& matrix, int target) {
    method searchMatrix02 (line 68) | bool searchMatrix02(vector<vector<int>>& matrix, int target) {
    method searchMatrix021 (line 84) | bool searchMatrix021(vector<vector<int>>& matrix, int target) {
    method searchMatrix022 (line 102) | bool searchMatrix022(vector<vector<int>>& matrix, int target) {
    method searchMatrix (line 142) | bool searchMatrix(vector<vector<int>>& matrix, int target) {

FILE: algorithms/cpp/search2DMatrix/search2DMatrix.cpp
  class Solution (line 27) | class Solution {
    method searchMatrix (line 29) | bool searchMatrix(vector<vector<int>>& matrix, int target) {
    method searchMatrix01 (line 35) | bool searchMatrix01(vector<vector<int>>& matrix, int target) {
    method searchMatrix02 (line 57) | bool searchMatrix02(vector<vector<int> > &matrix, int target) {
    method vertical_binary_search (line 69) | int vertical_binary_search(vector< vector<int> > v, int key){
    method binary_search (line 89) | int binary_search(vector<int> v, int key) {

FILE: algorithms/cpp/searchForRange/searchForRange.cpp
  function searchRange (line 35) | vector<int> searchRange(int A[], int n, int target) {
  function binary_search (line 61) | int binary_search(int A[], int low, int high, int key){
  function printVector (line 78) | void printVector( vector<int>&  pt)
  function main (line 88) | int main()

FILE: algorithms/cpp/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp
  class Solution (line 26) | class Solution {
    method search (line 28) | bool search(int A[], int n, int key) {

FILE: algorithms/cpp/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp
  function search (line 28) | int search(int A[], int n, int target) {
  function search1 (line 42) | int search1(int A[], int n, int key) {
  function search2 (line 82) | int search2(int A[], int n, int target) {
  function rotate_search (line 96) | int rotate_search(int A[], int low, int high, int key ) {
  function binary_search (line 123) | int binary_search(int A[], int n, int key) {
  function binary_search (line 140) | int binary_search(int A[], int low, int high, int key) {
  function rotate_array (line 157) | void rotate_array(int a[], int n, int pos){
  function printArray (line 185) | void printArray(int A[], int n) {
  function main (line 193) | int main(int argc, char** argv)

FILE: algorithms/cpp/searchInsertPosition/searchInsertPosition.cpp
  function binary_search (line 24) | int binary_search(int A[], int n, int key) {
  function searchInsert (line 40) | int searchInsert(int A[], int n, int target) {
  function main (line 45) | int main()

FILE: algorithms/cpp/seatReservationManager/SeatReservationManager.cpp
  class SeatManager (line 51) | class SeatManager {
    method SeatManager (line 55) | SeatManager(int n) {
    method reserve (line 61) | int reserve() {
    method unreserve (line 68) | void unreserve(int seatNumber) {

FILE: algorithms/cpp/secondLargestDigitInAString/SecondLargestDigitInAString.cpp
  class Solution (line 30) | class Solution {
    method secondHighest (line 32) | int secondHighest(string s) {

FILE: algorithms/cpp/sentenceScreenFitting/main.cpp
  function main (line 20) | int main(int argc, const char * argv[]) {

FILE: algorithms/cpp/sentenceScreenFitting/sentenceScreenFitting.cpp
  function SentenceScreenFitting (line 87) | int SentenceScreenFitting(char stc[][M], int row, int col, size_t l)

FILE: algorithms/cpp/sentenceScreenFitting/sentenceScreenFitting.h
  function class (line 23) | class Solution {

FILE: algorithms/cpp/sentenceSimilarity/SentenceSimilarity.III.cpp
  class Solution (line 51) | class Solution {
    method isWord (line 53) | bool isWord(char ch) {
    method isSpace (line 56) | bool isSpace(char ch) {
    method split (line 59) | void split(string& s, vector<string>& words) {
    method print (line 70) | void print(vector<string>& v) {
    method areSentencesSimilar (line 78) | bool areSentencesSimilar(string sentence1, string sentence2) {

FILE: algorithms/cpp/serializeAndDeserializeBinaryTree/SerializeAndDeserializeBinaryTree.cpp
  type TreeNode (line 47) | struct TreeNode {
    method TreeNode (line 51) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  class Codec (line 55) | class Codec {
    method string (line 59) | string serialize(TreeNode* root) {
    method TreeNode (line 65) | TreeNode* deserialize(string data) {
    method string (line 78) | string serialize01(TreeNode* root) {
    method TreeNode (line 89) | TreeNode* deserialize01(string data) {
    method serializeHelper (line 100) | void serializeHelper(TreeNode* root, vector<TreeNode*>& v) {
    method TreeNode (line 111) | TreeNode* deserializeHelper(vector<TreeNode*> &v, int& index) {
    method split (line 124) | void split(const string &s, char delim, vector<TreeNode*> &elems) {
    method string (line 143) | string serialize02(TreeNode* root) {
    method TreeNode (line 150) | TreeNode* deserialize02(string data) {
    method serialize (line 156) | void serialize(TreeNode* root, ostringstream& out) {
    method TreeNode (line 166) | TreeNode* deserialize(istringstream& in) {
  function main (line 183) | int main(int argc, char** argv)

FILE: algorithms/cpp/setMatrixZeroes/setMatrixZeroes.cpp
  class Solution (line 21) | class Solution {
    method Solution (line 23) | Solution(){
    method setZeroes (line 26) | void setZeroes(vector<vector<int> > &matrix) {
    method setZeroes1 (line 33) | void setZeroes1(vector<vector<int> > &matrix) {
    method setZeroes2 (line 63) | void setZeroes2(vector<vector<int> > &matrix) {

FILE: algorithms/cpp/shortEncodingOfWords/ShortEncodingOfWords.cpp
  class Solution (line 29) | class Solution {
    method comp (line 31) | static bool comp(string a,string b){
    method minimumLengthEncoding (line 34) | int minimumLengthEncoding(vector<string>& words) {

FILE: algorithms/cpp/shortestPalindrome/ShortestPalindrome.cpp
  function isPalindrome (line 26) | bool isPalindrome(string& s, int begin, int end) {
  function string (line 36) | string shortestPalindrome_bf(string& s) {
  function string (line 52) | string shortestPalindrome_dp(string& s) {
  function string (line 131) | string shortestPalindrome_kmp(string& s) {
  function string (line 170) | string shortestPalindrome(string s) {
  function main (line 177) | int main(int argc, char**argv)

FILE: algorithms/cpp/shuffleAnArray/ShuffleAnArray.cpp
  class Solution (line 26) | class Solution {
    method Solution (line 28) | Solution(vector<int> nums) : _nums(nums), _solution(nums) {
    method reset (line 33) | vector<int> reset() {
    method shuffle (line 38) | vector<int> shuffle() {

FILE: algorithms/cpp/shuffleString/ShuffleString.cpp
  class Solution (line 51) | class Solution {
    method string (line 53) | string restoreString(string s, vector<int>& indices) {

FILE: algorithms/cpp/shuffleTheArray/ShuffleTheArray.cpp
  class Solution (line 34) | class Solution {
    method shuffle (line 36) | vector<int> shuffle(vector<int>& nums, int n) {

FILE: algorithms/cpp/signOfTheProductOfAnArray/SignOfTheProductOfAnArray.cpp
  class Solution (line 41) | class Solution {
    method arraySign (line 43) | int arraySign(vector<int>& nums) {

FILE: algorithms/cpp/simplifyPath/simplifyPath.cpp
  function split (line 41) | vector<string> split(const string &s, char delim) {
  function string (line 48) | string simplifyPath(string path) {
  function main (line 78) | int main(int argc, char** argv)

FILE: algorithms/cpp/singleNumber/singleNumber.II.cpp
  class Solution (line 15) | class Solution {
    method Solution (line 17) | Solution(){
    method singleNumber (line 22) | int singleNumber(int A[], int n) {
    method singleNumber_1 (line 41) | int singleNumber_1(int A[], int n) {
    method singleNumber_2 (line 72) | int singleNumber_2(int A[], int n) {

FILE: algorithms/cpp/singleNumber/singleNumber.III.cpp
  class Solution (line 67) | class Solution {
    method singleNumber (line 69) | vector<int> singleNumber(vector<int>& nums) {

FILE: algorithms/cpp/singleNumber/singleNumber.cpp
  function singleNumber (line 19) | int singleNumber(int A[], int n) {
  function main (line 27) | int main()

FILE: algorithms/cpp/singleThreadedCpu/SingleThreadedCpu.cpp
  class Solution (line 60) | class Solution {
    method print (line 63) | void print(T q) {
    method getOrder (line 72) | vector<int> getOrder(vector<vector<int>>& tasks) {

FILE: algorithms/cpp/slidingWindowMaximum/SlidingWindowMaximum.cpp
  function maxSlidingWindow02 (line 45) | vector<int> maxSlidingWindow02(vector<int>& nums, int k) {
  function maxSlidingWindow01 (line 67) | vector<int> maxSlidingWindow01(vector<int>& nums, int k) {
  function maxSlidingWindow (line 92) | vector<int> maxSlidingWindow(vector<int>& nums, int k) {
  function printVector (line 97) | void printVector( vector<int>& v ) {
  function main (line 105) | int main(int argc, char** argv)

FILE: algorithms/cpp/smallestStringStartingFromLeaf/SmallestStringStartingFromLeaf.cpp
  class Solution (line 45) | class Solution {
    method string (line 47) | string smallestFromLeaf(TreeNode* root) {
    method smallestFromLeafHelper (line 53) | void smallestFromLeafHelper(TreeNode* root, string str, string& result) {

FILE: algorithms/cpp/sortArrayByParity/SortArrayByParity.II.cpp
  class Solution (line 28) | class Solution {
    method isEven (line 30) | bool isEven(int &x) {
    method sortArrayByParityII (line 33) | vector<int> sortArrayByParityII(vector<int>& A) {

FILE: algorithms/cpp/sortArrayByParity/SortArrayByParity.cpp
  class Solution (line 25) | class Solution {
    method isEven (line 27) | bool isEven(int& x) {
    method sortArrayByParity (line 30) | vector<int> sortArrayByParity(vector<int>& A) {

FILE: algorithms/cpp/sortColors/sortColors.cpp
  function swap (line 28) | void swap(int*a, int*b)
  function sortColors (line 35) | void sortColors(int a[], int n) {
  function printArray (line 51) | void printArray(int a[], int n) {
  function main (line 58) | int main(int argc, char** argv)

FILE: algorithms/cpp/sortList/sortList.cpp
  type ListNode (line 16) | struct ListNode {
    method ListNode (line 19) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 24) | ListNode *sortList(ListNode *head) {
    method ListNode (line 19) | ListNode(int x) : val(x), next(NULL) {}
  function ListNode (line 41) | ListNode *mergeTwoLists(ListNode* head1, ListNode* head2){
    method ListNode (line 19) | ListNode(int x) : val(x), next(NULL) {}
  function printList (line 63) | void printList(ListNode* h)
  function ListNode (line 72) | ListNode* createList(int a[], int n)
    method ListNode (line 19) | ListNode(int x) : val(x), next(NULL) {}
  function main (line 87) | int main(int argc, char** argv)

FILE: algorithms/cpp/sortingTheSentence/SortingTheSentence.cpp
  class Solution (line 42) | class Solution {
    method string (line 44) | string sortSentence(string s) {

FILE: algorithms/cpp/spiralMatrix/spiralMatrix.II.cpp
  function generateMatrix (line 31) | vector<vector<int> > generateMatrix(int n) {
  function generateMatrix (line 35) | vector<vector<int> > generateMatrix(int n, int m) {
  function printArray (line 69) | void printArray(vector<int> v)
  function printMatrix (line 78) | void printMatrix(vector< vector<int> > &vv)
  function main (line 87) | int main(int argc, char** argv)

FILE: algorithms/cpp/spiralMatrix/spiralMatrix.cpp
  function spiralOrder (line 29) | vector<int> spiralOrder(vector<vector<int> > &matrix) {
  function printArray (line 59) | void printArray(vector<int> v)
  function printMatrix (line 68) | void printMatrix(vector< vector<int> > &vv)
  function createMatrix (line 76) | vector< vector<int> > createMatrix(int n, int m)
  function main (line 90) | int main(int argc, char** argv)

FILE: algorithms/cpp/splitArrayLargestSum/SplitArrayLargestSum.cpp
  class Solution (line 29) | class Solution {
    method splitArray (line 36) | int splitArray(vector<int>& nums, int m) {
    method hasSmallerSum (line 57) | bool hasSmallerSum(vector<int>& nums, int m, int sum) {

FILE: algorithms/cpp/splittingAStringIntoDescendingConsecutiveValues/SplittingAStringIntoDescendingConsecutiveValues.cpp
  class Solution (line 56) | class Solution {
    method getNum (line 60) | bool getNum(string& s, long target) {
    method firstNum (line 72) | long firstNum(string& s, int len) {
    method splitString (line 81) | bool splitString(string s) {

FILE: algorithms/cpp/sqrt/sqrt.cpp
  function sqrt (line 18) | int sqrt(int x) {
  function sqrt_nt (line 41) | int sqrt_nt(int x) {
  function main (line 54) | int main(int argc, char**argv)

FILE: algorithms/cpp/squaresOfASortedArray/SquaresOfASortedArray.cpp
  class Solution (line 28) | class Solution {
    method sortedSquares (line 30) | vector<int> sortedSquares(vector<int>& A) {

FILE: algorithms/cpp/strStr/strStr.cpp
  function main (line 99) | int main(int argc, char** argv)

FILE: algorithms/cpp/stringToIntegerAtoi/stringToIntegerAtoi.cpp
  function atoi (line 44) | int atoi(const char *str) {
  function main (line 78) | int main()

FILE: algorithms/cpp/stringWithoutAAAOrBBB/StringWithoutAAAOrBBB.cpp
  class Solution (line 31) | class Solution {
    method string (line 33) | string strWithout3a3b(int A, int B) {

FILE: algorithms/cpp/subsets/subsets.II.cpp
  function subsets (line 42) | vector<vector<int> > subsets(vector<int> &S) {
  function combine (line 53) | vector<vector<int> > combine(vector<int> &v, int k) {
  function getCombination (line 60) | void getCombination(vector<int> &v, int n, int k, vector<int>& solution,...
  function printResult (line 78) | void printResult(vector<vector<int> >& result)
  function printArray (line 89) | void printArray(vector<int>& v){
  function main (line 97) | int main(int argc, char** argv)

FILE: algorithms/cpp/subsets/subsets.cpp
  function subsets (line 44) | vector<vector<int> > subsets(vector<int> &S) {
  function combine (line 54) | vector<vector<int> > combine(vector<int>& v, int k) {
  function combine1 (line 63) | vector<vector<int> > combine1(vector<int> &v, int k) {
  function getCombination (line 70) | void getCombination(vector<int> &v, int n, int k, vector<int>& solution,...
  function combine2 (line 85) | vector<vector<int> > combine2(vector<int> &v, int k) {
  function printResult (line 134) | void printResult(vector<vector<int> >& result)
  function printArray (line 145) | void printArray(vector<int>& v){
  function main (line 153) | int main(int argc, char** argv)

FILE: algorithms/cpp/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp
  function findSubstring (line 27) | vector<int> findSubstring(string S, vector<string> &L) {
  function main (line 93) | int main(int argc, char**argv)

FILE: algorithms/cpp/substringsOfSizeThreeWithDistinctCharacters/SubstringsOfSizeThreeWithDistinctCharacters.cpp
  class Solution (line 36) | class Solution {
    method countGoodSubstrings (line 38) | int countGoodSubstrings(string s) {

FILE: algorithms/cpp/sudokuSolver/sudokuSolver.cpp
  function initSudokuMask (line 33) | bool initSudokuMask(vector< vector<char> > &board){
  function recursiveSudoKu (line 60) | bool recursiveSudoKu(vector< vector<char> > &board, int row, int col){
  function solveSudoku (line 95) | void solveSudoku(vector<vector<char> > &board) {
  function main (line 103) | int main(int argc, char**argv) {

FILE: algorithms/cpp/sumOfBeautyOfAllSubstrings/SumOfBeautyOfAllSubstrings.cpp
  class Solution (line 32) | class Solution {
    method beauty (line 34) | int beauty(string& s, int start, int end) {
    method beautySum (line 48) | int beautySum(string s) {
    method beautySum01 (line 53) | int beautySum01(string& s) {
    method beautySum02 (line 64) | int beautySum02(string& s) {

FILE: algorithms/cpp/sumOfDigitsInBaseK/SumOfDigitsInBaseK.cpp
  class Solution (line 31) | class Solution {
    method sumBase (line 33) | int sumBase(int n, int k) {

FILE: algorithms/cpp/sumOfDigitsOfStringAfterConvert/SumOfDigitsOfStringAfterConvert.cpp
  class Solution (line 53) | class Solution {
    method sumChar (line 55) | int sumChar(char c) {
    method sumInt (line 59) | int sumInt(int x) {
    method getLucky (line 67) | int getLucky(string s, int k) {

FILE: algorithms/cpp/sumOfEvenNumbersAfterQueries/SumOfEvenNumbersAfterQueries.cpp
  class Solution (line 38) | class Solution {
    method sumEvenAfterQueries (line 40) | vector<int> sumEvenAfterQueries(vector<int>& A, vector<vector<int>>& q...

FILE: algorithms/cpp/sumOfFlooredPairs/SumOfFlooredPairs.cpp
  class Solution (line 35) | class Solution {
    method sumOfFlooredPairs (line 37) | int sumOfFlooredPairs(vector<int>& nums) {

FILE: algorithms/cpp/sumOfLeftLeaves/SumOfLeftLeaves.cpp
  class Solution (line 30) | class Solution {
    method sumOfLeftLeaves_recursion_v1 (line 34) | void sumOfLeftLeaves_recursion_v1(TreeNode* root, int& result) {
    method sumOfLeftLeaves_recursion_v2 (line 47) | int sumOfLeftLeaves_recursion_v2(TreeNode* root) {
    method sumOfLeftLeaves (line 60) | int sumOfLeftLeaves(TreeNode* root) {

FILE: algorithms/cpp/sumOfTwoIntegers/SumOfTwoIntegers.cpp
  class Solution (line 18) | class Solution {
    method getSum (line 20) | int getSum(int x, int y) {

FILE: algorithms/cpp/sumOfUniqueElements/SumOfUniqueElements.cpp
  class Solution (line 36) | class Solution {
    method sumOfUnique (line 38) | int sumOfUnique(vector<int>& nums) {
    method sumOfUnique_general (line 43) | int sumOfUnique_general(vector<int>& nums) {
    method sumOfUnique_special (line 62) | int sumOfUnique_special(vector<int>& nums) {

FILE: algorithms/cpp/sumRootToLeafNumber/sumRootToLeafNumber.cpp
  class Solution (line 35) | class Solution {
    method sumNumbers (line 37) | int sumNumbers(TreeNode *root) {

FILE: algorithms/cpp/summaryRanges/SummaryRanges.cpp
  class Solution (line 16) | class Solution {
    method string (line 18) | string makeRange(int start, int end) {
    method summaryRanges (line 28) | vector<string> summaryRanges(vector<int>& nums) {

FILE: algorithms/cpp/superUglyNumber/SuperUglyNumber.cpp
  class Solution (line 45) | class Solution {
    method nthSuperUglyNumber (line 48) | int nthSuperUglyNumber(int n, vector<int>& primes) {

FILE: algorithms/cpp/surroundedRegions/surroundedRegions.cpp
  function markOpen (line 38) | void markOpen(vector< vector<char> > &board, int row, int col, int r, in...
  function solve_recursively (line 47) | void solve_recursively(vector< vector<char> > &board) {
  type position (line 87) | struct position{
    method set (line 89) | void set(int r, int c) { row = r; col = c; }
    method position (line 90) | position(int r, int c): row(r), col(c) {}
  function solve_non_recursively (line 93) | void solve_non_recursively(vector< vector<char> > &board) {
  class UnionFind (line 173) | class UnionFind {
    method UnionFind (line 178) | UnionFind(int n) {
    method count (line 193) | int count() { return count_; }
    method find (line 195) | int find(int p) {
    method connected (line 203) | bool connected(int p, int q) {
    method connect (line 207) | void connect(int p, int q) {
  class Solution (line 221) | class Solution {
    method solve (line 223) | void solve(vector<vector<char> >& board) {
  function solve (line 254) | void solve(vector< vector<char> > &board) {
  function construct (line 263) | void construct(vector< vector<char> > &board, int row, int col) {
  function print (line 277) | void print(vector< vector<char> > &board) {
  function main (line 287) | int main(int argc, char** argv )

FILE: algorithms/cpp/swapNodesInPairs/swapNodesInPairs.cpp
  class Solution (line 26) | class Solution {
    method Solution (line 28) | Solution(){
    method ListNode (line 36) | ListNode *swapPairs(ListNode *head) {
    method ListNode (line 43) | ListNode *swapPairs1(ListNode *head) {
    method ListNode (line 52) | ListNode *swapPairs2(ListNode *head) {
    method ListNode (line 75) | ListNode* swapPairs3(ListNode* head) {

FILE: algorithms/cpp/symmetricTree/symmetricTree.cpp
  class Solution (line 59) | class Solution {
    method Solution (line 61) | Solution(){
    method isSymmetric (line 65) | bool isSymmetric(TreeNode *root) {
    method isSymmetric (line 71) | bool isSymmetric(TreeNode *p, TreeNode *q){
    method isSymmetric1 (line 78) | bool isSymmetric1(TreeNode *p, TreeNode *q){
    method isSymmetric2 (line 87) | bool isSymmetric2(TreeNode *p, TreeNode *q){

FILE: algorithms/cpp/targetSum/targetSum.cpp
  class Solution (line 25) | class Solution {
    method findTargetSumWays (line 27) | int findTargetSumWays(vector<int>& nums, int S) {

FILE: algorithms/cpp/textJustification/textJustification.cpp
  function fullJustify (line 50) | vector<string> fullJustify(vector<string> &words, int L) {
  function printVector (line 110) | void printVector(vector<string> &words, bool newline=false) {
  function test (line 118) | void test(const char* A[], int len, int L) {
  function main (line 131) | int main(int argc, char** argv)

FILE: algorithms/cpp/theSkylineProblem/TheSkylineProblem.cpp
  class Solution (line 92) | class Solution {
    method getSkyline (line 95) | vector<pair<int, int>> getSkyline(vector<vector<int>>& buildings) {

FILE: algorithms/cpp/thirdMaximumNumber/ThirdMaximumNumber.cpp
  class Solution (line 38) | class Solution {
    method nMax (line 40) | int nMax(vector<int>& nums, int n) {
    method thirdMax (line 48) | int thirdMax(vector<int>& nums) {

FILE: algorithms/cpp/thousandSeparator/ThousandSeparator.cpp
  class Solution (line 34) | class Solution {
    method string (line 36) | string thousandSeparator(int n) {

FILE: algorithms/cpp/threeConsecutiveOdds/ThreeConsecutiveOdds.cpp
  class Solution (line 28) | class Solution {
    method threeConsecutiveOdds (line 31) | bool threeConsecutiveOdds(vector<int>& arr) {

FILE: algorithms/cpp/timeBasedKeyValueStore/TimeBasedKeyValueStore.cpp
  class TimeMap (line 51) | class TimeMap {
    method TimeMap (line 57) | TimeMap() {
    method set (line 61) | void set(string key, string value, int timestamp) {
    method string (line 66) | string get(string key, int timestamp) {

FILE: algorithms/cpp/timeNeededToInformAllEmployees/TimeNeededToInformAllEmployees.cpp
  class Solution (line 37) | class Solution {
    method dfs (line 40) | long long int dfs(vector<vector<int>>& adj, vector<int>& informTime, i...
    method numOfMinutes (line 49) | int numOfMinutes(int n, int headID, vector<int>& manager, vector<int>&...

FILE: algorithms/cpp/topKFrequentElements/topKFrequentElements.cpp
  class Solution (line 19) | class Solution {
    type element (line 21) | struct element//structure consisting of every distinct number in the v...
    method topKFrequent (line 34) | vector<int> topKFrequent(vector<int>& nums, int k) {

FILE: algorithms/cpp/totalHammingDistance/totalHammingDistance.cpp
  class Solution (line 39) | class Solution {
    method totalHammingDistance (line 41) | int totalHammingDistance(vector<int>& nums) {

FILE: algorithms/cpp/trappingRainWater/trappingRainWater.cpp
  function trap (line 41) | int trap(int a[], int n) {
  function main (line 76) | int main()

FILE: algorithms/cpp/treeOfCoprimes/TreeOfCoprimes.cpp
  class Solution (line 54) | class Solution {
    method gcd (line 58) | int gcd(int a, int b) {
    method print (line 65) | void print(vector<int>& v, int len, vector<int>& nums){
    method getCoprimes (line 74) | vector<int> getCoprimes(vector<int>& nums, vector<vector<int>>& edges) {
    method getCoprimesDFS (line 95) | void getCoprimesDFS(int parent, int root,

FILE: algorithms/cpp/triangle/triangle.cpp
  class Solution (line 31) | class Solution {
    method minimumTotal (line 34) | int minimumTotal(vector<vector<int> > &triangle) {
    method min (line 79) | inline int min(int x, int y, int z){
  function main (line 86) | int main()

FILE: algorithms/cpp/triplesWithBitwiseANDEqualToZero/TriplesWithBitwiseAndEqualToZero.cpp
  class Solution (line 39) | class Solution {
    method countTriplets (line 41) | int countTriplets(vector<int>& A) {

FILE: algorithms/cpp/truncateSentence/TruncateSentence.cpp
  class Solution (line 47) | class Solution {
    method isAlpha (line 49) | bool isAlpha(const char& ch) {
    method string (line 53) | string truncateSentence(string s, int k) {

FILE: algorithms/cpp/tupleWithSameProduct/TupleWithSameProduct.cpp
  class Solution (line 45) | class Solution {
    method tupleSameProduct (line 47) | int tupleSameProduct(vector<int>& nums) {

FILE: algorithms/cpp/twoArraysEqualByReversingSubArrays/MakeTwoArraysEqualByReversingSubArrays.cpp
  class Solution (line 53) | class Solution {
    method canBeEqual (line 56) | bool canBeEqual(vector<int>& target, vector<int>& arr) {

FILE: algorithms/cpp/twoCityScheduling/TwoCityScheduling.cpp
  class Solution (line 33) | class Solution {
    method diff (line 35) | static int diff(vector<int>& x) {
    method cmpfunc (line 38) | static bool cmpfunc(vector<int>& lhs, vector<int>& rhs) {
    method twoCitySchedCost (line 46) | int twoCitySchedCost(vector<vector<int>>& costs) {

FILE: algorithms/cpp/twoSum/twoSum.II.cpp
  class Solution (line 23) | class Solution {
    method twoSum (line 25) | vector<int> twoSum(vector<int> &numbers, int target) {

FILE: algorithms/cpp/twoSum/twoSum.III.cpp
  class TwoSum (line 20) | class TwoSum {
    method add (line 26) | void add(int number) {
    method find (line 31) | bool find(int value) {

FILE: algorithms/cpp/twoSum/twoSum.cpp
  class Solution (line 21) | class Solution {
    method twoSum (line 52) | vector<int> twoSum(vector<int> &numbers, int target) {
    method twoSum (line 71) | vector<int> twoSum(vector<int>& nums, int target) {

FILE: algorithms/cpp/uglyNumber/UglyNumber.II.cpp
  class Solution (line 30) | class Solution {
    method min (line 33) | int min(int a, int b) {
    method min (line 37) | int min(int a, int b, int c) {
    method nthUglyNumber01 (line 69) | int nthUglyNumber01(int n) {
    method nthUglyNumber02 (line 86) | int nthUglyNumber02(int n) {
    method nthUglyNumber (line 103) | int nthUglyNumber(int n) {

FILE: algorithms/cpp/uglyNumber/UglyNumber.cpp
  class Solution (line 19) | class Solution {
    method isUgly (line 22) | bool isUgly(int num) {

FILE: algorithms/cpp/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp
  type TreeNode (line 44) | struct TreeNode {
    method TreeNode (line 48) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function generateTrees (line 53) | vector<TreeNode*> generateTrees(int n) {
  function generateTrees (line 60) | vector<TreeNode*> generateTrees(int low, int high){
  function printTree (line 86) | void printTree(TreeNode *root){
  function main (line 98) | int main(int argc, char** argv)

FILE: algorithms/cpp/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp
  function numTrees (line 26) | int numTrees(int n) {
  function numTrees1 (line 30) | int numTrees1(int n) {
  function numTrees2 (line 48) | int numTrees2(int n) {
  function main (line 63) | int main(int argc, char** argv)

FILE: algorithms/cpp/uniqueEmailAddresses/UniqueEmailAddresses.cpp
  class Solution (line 45) | class Solution {
    method numUniqueEmails (line 47) | int numUniqueEmails(vector<string>& emails) {

FILE: algorithms/cpp/uniqueMorseCodeWords/UniqueMorseCodeWords.cpp
  class Solution (line 49) | class Solution {
    method uniqueMorseRepresentations (line 51) | int uniqueMorseRepresentations(vector<string>& words) {

FILE: algorithms/cpp/uniqueNumberOfOccurrences/Unique-Number-of-Occurrences.cpp
  class Solution (line 30) | class Solution {
    method uniqueOccurrences (line 32) | bool uniqueOccurrences(vector<int>& arr) {

FILE: algorithms/cpp/uniquePaths/UniquePaths.III.cpp
  class Solution (line 48) | class Solution {
    method uniquePathsIII (line 50) | int uniquePathsIII(vector<vector<int>>& grid) {
    method findStartPoint (line 59) | bool findStartPoint(vector<vector<int>> &grid, int& x, int& y) {
    method check (line 70) | bool check(vector<vector<int>> &grid ) {
    method uniquePathsHelper (line 80) | void uniquePathsHelper(vector<vector<int>> &grid, int x, int y, int& p...

FILE: algorithms/cpp/uniquePaths/uniquePaths.II.cpp
  function uniquePathsWithObstacles (line 33) | int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
  function uniquePathsWithObstacles (line 58) | int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {

FILE: algorithms/cpp/uniquePaths/uniquePaths.cpp
  function printMatrix (line 40) | void printMatrix(int*a, int m, int n)
  function uniquePaths (line 61) | int uniquePaths(int m, int n) {
  function uniquePaths (line 85) | int uniquePaths(int m, int n) {
  function main (line 97) | int main(int argc, char** argv)

FILE: algorithms/cpp/validNumber/validNumber.cpp
  function isdigit (line 26) | bool isdigit(const char c){
  function isspace (line 29) | bool isspace(const char c) {
  function isNumber (line 33) | bool isNumber(const char *s) {
  function main (line 87) | int main(int argc, char** argv)

FILE: algorithms/cpp/validPalindrome/validPalindrome.cpp
  class Solution (line 21) | class Solution {
    method isPalindrome (line 23) | bool isPalindrome(string s) {
    method string (line 33) | string removeNoise(string& s){

FILE: algorithms/cpp/validParentheses/validParentheses.cpp
  function isValid (line 21) | bool isValid(string s) {
  function main (line 41) | int main(int argc, char**argv)

FILE: algorithms/cpp/validPerfectSquare/ValidPerfectSquare.cpp
  class Solution (line 31) | class Solution {
    method isPerfectSquare1 (line 34) | bool isPerfectSquare1(int num) {
    method isPerfectSquare2 (line 52) | bool isPerfectSquare2(int num) {
    method isPerfectSquare (line 61) | bool isPerfectSquare(int num) {

FILE: algorithms/cpp/validSudoku/validSudoku.cpp
  class Solution (line 20) | class Solution {
    method isValidSudoku (line 22) | bool isValidSudoku(vector<vector<char> > &board) {

FILE: algorithms/cpp/validateBinarySearchTree/validateBinarySearchTree.cpp
  type TreeNode (line 42) | struct TreeNode {
    method TreeNode (line 46) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function isValidBST (line 49) | bool isValidBST(TreeNode *root) {
  function TreeNode (line 78) | TreeNode* createTree(int a[], int n)
    method TreeNode (line 46) | TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  function main (line 104) | int main()

FILE: algorithms/cpp/verifyPreorderSerializationOfABinaryTree/VerifyPreorderSerializationOfABinaryTree.cpp
  class Solution (line 46) | class Solution {
    method isValidSerialization (line 65) | bool isValidSerialization(string preorder) {
    method split (line 78) | void split(const string &s, char delim, vector<string> &elems) {

FILE: algorithms/cpp/verticalOrderTraversalOfABinaryTree/VerticalOrderTraversalOfABinaryTree.cpp
  class Item (line 86) | class Item {
    method Item (line 88) | Item(int _x, int _y, int _val):x(_x), y(_y),val(_val) {}
  class ItemCmp (line 93) | class ItemCmp {
  function getValue (line 100) | int getValue(const Item& i) {
  class Solution (line 104) | class Solution {
    method verticalTraversal (line 106) | vector<vector<int>> verticalTraversal(TreeNode* root) {
    method verticalTraversalHelper (line 120) | void verticalTraversalHelper(TreeNode* root, int x, int y,

FILE: algorithms/cpp/videoStitching/VideoStitching.cpp
  class Solution (line 58) | class Solution {
    method videoStitching (line 60) | int videoStitching(vector<vector<int>>& clips, int T) {
    method print (line 105) | void print(vector<vector<int>>& clips) {
    method print (line 112) | void print(vector<int>& v) {

FILE: algorithms/cpp/waysToSplitArrayIntoThreeSubarrays/WaysToSplitArrayIntoThreeSubarrays.cpp
  class Solution (line 46) | class Solution {
    method waysToSplit (line 48) | int waysToSplit(vector<int>& nums) {
    method binary_search (line 60) | int binary_search(vector<int>& presum, int left, int i, bool searchLef...
    method waysToSplit_BS (line 85) | int waysToSplit_BS(vector<int>& presum) {
    method waysToSplit_TLE (line 102) | int waysToSplit_TLE(vector<int>& presum) {

FILE: algorithms/cpp/wiggleSort/WiggleSort.II.cpp
  class Solution (line 24) | class Solution {
    method wiggleSort01 (line 48) | void wiggleSort01(vector<int>& nums) {
    method wiggleSort02 (line 67) | void wiggleSort02(vector<int>& nums) {
    method wiggleSort (line 89) | void wiggleSort(vector<int>& nums) {

FILE: algorithms/cpp/wiggleSubsequence/wiggleSubsequence.cpp
  class Solution (line 56) | class Solution {
    method wiggleMaxLength (line 58) | int wiggleMaxLength(vector<int>& nums) {

FILE: algorithms/cpp/wildcardMatching/wildcardMatching.cpp
  function isMatch (line 34) | bool isMatch(const char *s, const char *p) {
  function main (line 67) | int main(int argc, char** argv)

FILE: algorithms/cpp/wordBreak/wordBreak.II.cpp
  function wordBreak (line 61) | vector<string> wordBreak(string s, set<string> &dict, map<string, vector...
  function wordBreak (line 90) | void wordBreak(string s, set<string> &dict, string str, vector<string>& ...
  function wordBreak_dp (line 143) | vector<string> wordBreak_dp(string s, set<string> &dict) {
  function wordBreak (line 167) | vector<string> wordBreak(string s, set<string> &dict) {
  function printVector (line 197) | void printVector(vector<string>& v)
  function main (line 204) | int main()

FILE: algorithms/cpp/wordBreak/wordBreak.cpp
  function wordBreak (line 24) | bool wordBreak(string s, set<string> &dict) {
  function main (line 51) | int main()

FILE: algorithms/cpp/wordLadder/wordLadder.II.cpp
  function generatePath (line 127) | void generatePath( string start, string end,
  function findLadders (line 147) | vector< vector<string> >
  function printLadders (line 170) | void printLadders(vector< vector<string> > &ladders){
  function main (line 180) | int main(int argc, char** argv)

FILE: algorithms/cpp/wordLadder/wordLadder.cpp
  class Solution (line 76) | class Solution {
    method ladderLength (line 78) | int ladderLength(string start, string end, unordered_set<string> &dict) {

FILE: algorithms/cpp/wordPattern/WordPattern.cpp
  class Solution (line 27) | class Solution {
    method split (line 31) | vector<string> split(string str, char delimiter) {
    method wordPattern (line 45) | bool wordPattern(string pattern, string str) {

FILE: algorithms/cpp/wordSearch/wordSearch.II.cpp
  class TrieNode (line 41) | class TrieNode {
    method TrieNode (line 43) | TrieNode(string s):isWord(false), word(s) {
    method TrieNode (line 46) | TrieNode* & operator [] (char ch) {
    method TrieNode (line 49) | TrieNode* & operator [] (int idx) {
  class TrieTree (line 60) | class TrieTree {
    method TrieTree (line 62) | TrieTree():root(new TrieNode("")) { }
    method TrieNode (line 64) | TrieNode* getRoot() {
    method addWord (line 67) | void addWord(string& s){
    method freeTree (line 80) | void freeTree(TrieNode* node){
  class Solution (line 92) | class Solution {
    method findWords (line 94) | void findWords(vector<vector<char>>& board, TrieNode* root, int row, i...
    method findWords (line 125) | vector<string> findWords(vector<vector<char>>& board, vector<string>& ...

FILE: algorithms/cpp/wordSearch/wordSearch.cpp
  function exist (line 34) | bool exist(vector<vector<char> > &board, string& word, int idx, int row,...
  function exist (line 60) | bool exist(vector<vector<char> > &board, string word) {
  function buildBoard (line 77) | vector< vector<char> > buildBoard(char b[][5], int r, int c) {
  function main (line 88) | int main(int argc, char** argv)

FILE: algorithms/cpp/zigZagConversion/zigZagConversion.cpp
  function string (line 30) | string convert(string s, int nRows) {
  function main (line 52) | int main(int argc, char**argv){

FILE: algorithms/golang/twoSum/twoSum.go
  function twoSum (line 3) | func twoSum(nums []int, target int) []int {

FILE: algorithms/java/src/LargestNumberAfterMutatingSubstring/largestNumberAfterMutatingSubstring.java
  class Solution (line 49) | class Solution {
    method maximumNumber (line 50) | public String maximumNumber(String num, int[] change) {

FILE: algorithms/java/src/MaxSubArray/MaxSubarray.java
  class Solution (line 15) | class Solution {
    method maxSubArray (line 16) | public int maxSubArray(int[] nums) {

FILE: algorithms/java/src/RotateImage/rotateImage.java
  class Solution (line 27) | class Solution {
    method rotate (line 28) | public void rotate(int[][] matrix) {

FILE: algorithms/java/src/balancedBinaryTree/TreeNode.java
  class TreeNode (line 6) | public class TreeNode {
    method TreeNode (line 9) | public TreeNode(int val) {

FILE: algorithms/java/src/balancedBinaryTree/balancedBinaryTree.java
  class balancedBinaryTree (line 22) | public class balancedBinaryTree {
    method isBalanced (line 27) | public boolean isBalanced(TreeNode root) {
    class Result (line 33) | private class Result {
      method Result (line 36) | Result(boolean isBalanced, int height) {
    method helper (line 41) | private Result helper(TreeNode root, int depth) {

FILE: algorithms/java/src/balancedBinaryTree/balancedBinaryTreeTest.java
  class balancedBinaryTreeTest (line 11) | public class balancedBinaryTreeTest {
    method testIsBalanced (line 13) | @Test

FILE: algorithms/java/src/binarySearchTreeIterator/TreeNode.java
  class TreeNode (line 6) | public class TreeNode {
    method TreeNode (line 9) | public TreeNode(int val) {

FILE: algorithms/java/src/binarySearchTreeIterator/binarySearchTreeIterator.java
  class binarySearchTreeIterator (line 39) | public class binarySearchTreeIterator {
    method binarySearchTreeIterator (line 43) | public binarySearchTreeIterator(TreeNode root) {
    method hasNext (line 50) | public boolean hasNext() {
    method next (line 56) | public TreeNode next() {

FILE: algorithms/java/src/binarySearchTreeIterator/binarySearchTreeIteratorTest.java
  class binarySearchTreeIteratorTest (line 12) | public class binarySearchTreeIteratorTest {
    method testIterator (line 13) | @Test

FILE: algorithms/java/src/binaryTreeBFSTraversal/TreeNode.java
  class TreeNode (line 6) | public class TreeNode {
    method TreeNode (line 10) | TreeNode(int x) { val = x; }

FILE: algorithms/java/src/binaryTreeBFSTraversal/binaryTreeBFSTraversal.java
  class binaryTreeBFSTraversal (line 11) | public class binaryTreeBFSTraversal {
    method bfsTraversal (line 12) | public List<Integer> bfsTraversal(TreeNode root) {

FILE: algorithms/java/src/binaryTreeBFSTraversal/binaryTreeBFSTraversalTest.java
  class binaryTreeBFSTraversalTest (line 13) | public class binaryTreeBFSTraversalTest {
    method testPreorderTraversal (line 24) | @Test

FILE: algorithms/java/src/binaryTreeLevelOrderTraversal/TreeNode.java
  class TreeNode (line 6) | public class TreeNode {
    method TreeNode (line 10) | TreeNode(int x) { val = x; }

FILE: algorithms/java/src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.java
  class binaryTreeLevelOrderTraversal (line 57) | public class binaryTreeLevelOrderTraversal {
    method levelOrder (line 62) | public List<List<Integer>> levelOrder(TreeNode root) {

FILE: algorithms/java/src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversalTest.java
  class binaryTreeLevelOrderTraversalTest (line 14) | public class binaryTreeLevelOrderTraversalTest {
    method testLevelOrder (line 16) | @Test

FILE: algorithms/java/src/binaryTreeMaximumPathSum/TreeNode.java
  class TreeNode (line 6) | public class TreeNode {
    method TreeNode (line 10) | TreeNode(int x) { val = x; }

FILE: algorithms/java/src/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.java
  class binaryTreeMaximumPathSum (line 43) | public class binaryTreeMaximumPathSum {
    method maxPathSum (line 48) | public int maxPathSum(TreeNode root) {
    class Result (line 53) | private class Result {
      method Result (line 56) | Result(int sumToRoot, int sumToLeaf) {
    method helper (line 63) | private Result helper(TreeNode root) {

FILE: algorithms/java/src/binaryTreeMaximumPathSum/binaryTreeMaximumPathSumTest.java
  class binaryTreeMaximumPathSumTest (line 12) | public class binaryTreeMaximumPathSumTest {
    method testMaxPathSum (line 14) | @Test

FILE: algorithms/java/src/binaryTreePreorderTraversal/TreeNode.java
  class TreeNode (line 6) | public class TreeNode {
    method TreeNode (line 10) | TreeNode(int x) { val = x; }

FILE: algorithms/java/src/binaryTreePreorderTraversal/binaryTreePreorderTraversal.java
  class binaryTreePreorderTraversal (line 33) | public class binaryTreePreorderTraversal {
    method preorderTraversal (line 36) | public List<Integer> preorderTraversal(TreeNode root) {
    method traversal (line 43) | private void traversal(List<Integer> results, TreeNode root) {

FILE: algorithms/java/src/binaryTreePreorderTraversal/binaryTreePreorderTraversalTest.java
  class binaryTreePreorderTraversalTest (line 13) | public class binaryTreePreorderTraversalTest {
    method testPreorderTraversal (line 24) | @Test

FILE: algorithms/java/src/containerwithmostwater.java
  class Solution (line 10) | class Solution {
    method maxArea (line 11) | public int maxArea(int[] height) {

FILE: algorithms/java/src/countAndSay/CountAndSay.java
  class CountAndSay (line 34) | public class CountAndSay {
    method nextString (line 36) | public String nextString(String str) {
    method countAndSay (line 53) | public String countAndSay(int n) {

FILE: algorithms/java/src/countAndSay/TestCountAndSay.java
  class TestCountAndSay (line 8) | public class TestCountAndSay {
    method test (line 9) | @Test

FILE: algorithms/java/src/dynamicProgramming/climbStairs/climbStairs.java
  class climbStairs (line 17) | public class climbStairs {
    method climbStairs (line 22) | public int climbStairs(int n) {

FILE: algorithms/java/src/dynamicProgramming/climbStairs/climbStairsTest.java
  class climbStairsTest (line 10) | public class climbStairsTest {
    method testClimbStairs (line 12) | @Test

FILE: algorithms/java/src/dynamicProgramming/minimumPathSum/minimumPathSum.java
  class minimumPathSum (line 17) | public class minimumPathSum {
    method minPathSum (line 22) | public int minPathSum(int[][] grid) {

FILE: algorithms/java/src/dynamicProgramming/minimumPathSum/minimumPathSumTest.java
  class minimumPathSumTest (line 10) | public class minimumPathSumTest {
    method testMinPathSum (line 12) | @Test

FILE: algorithms/java/src/dynamicProgramming/triangle/triangle.java
  class triangle (line 35) | public class triangle {
    method minimumTotal1 (line 40) | public int minimumTotal1(List<List<Integer>> triangle) {
    method minimumTotal2 (line 69) | public int minimumTotal2(int[][] triangle) {

FILE: algorithms/java/src/dynamicProgramming/triangle/triangleTest.java
  class triangleTest (line 10) | public class triangleTest {
    method testMinimumTotal (line 12) | @Test

FILE: algorithms/java/src/dynamicProgramming/uniquePaths/uniquePaths.java
  class uniquePaths (line 38) | public class uniquePaths {
    method uniquePaths (line 43) | public int uniquePaths(int m, int n) {

FILE: algorithms/java/src/dynamicProgramming/uniquePaths/uniquePathsII.java
  class uniquePathsII (line 31) | public class uniquePathsII {
    method uniquePathsWithObstacles (line 36) | public int uniquePathsWithObstacles(int[][] obstacleGrid) {

FILE: algorithms/java/src/dynamicProgramming/uniquePaths/uniquePathsIITest.java
  class uniquePathsIITest (line 10) | public class uniquePathsIITest {
    method testUniquePathsWithObstacles (line 12) | @Test

FILE: algorithms/java/src/dynamicProgramming/uniquePaths/uniquePathsTest.java
  class uniquePathsTest (line 10) | public class uniquePathsTest {
    method testUniquePaths (line 12) | @Test

FILE: algorithms/java/src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.java
  class findMinimumInRotatedSortedArray (line 20) | public class findMinimumInRotatedSortedArray {
    method findMin (line 21) | public int findMin(int[] num) {

FILE: algorithms/java/src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArrayTest.java
  class findMinimumInRotatedSortedArrayTest (line 10) | public class findMinimumInRotatedSortedArrayTest {
    method testFindMin (line 12) | @Test

FILE: algorithms/java/src/findPeakElement/findPeakElement.java
  class findPeakElement (line 27) | public class findPeakElement {
    method findPeakElement (line 28) | public int findPeakElement(int[] nums) {

FILE: algorithms/java/src/findPeakElement/findPeakElementTest.java
  class findPeakElementTest (line 10) | public class findPeakElementTest {
    method testFindPeak (line 12) | @Test

FILE: algorithms/java/src/firstBadVersion/VersionControl.java
  class VersionControl (line 6) | public class VersionControl {
    method isBadVersion (line 8) | boolean isBadVersion(int version) {

FILE: algorithms/java/src/firstBadVersion/firstBadVersion.java
  class firstBadVersion (line 21) | public class firstBadVersion extends VersionControl {
    method firstBadVersion (line 22) | public int firstBadVersion(int n) {

FILE: algorithms/java/src/firstBadVersion/firstBadVersionTest.java
  class firstBadVersionTest (line 10) | public class firstBadVersionTest {
    method testFirstBadVersion (line 12) | @Test

FILE: algorithms/java/src/inorderSuccessorInBST/TreeNode.java
  class TreeNode (line 6) | public class TreeNode {
    method TreeNode (line 10) | TreeNode(int x) { val = x; }

FILE: algorithms/java/src/inorderSuccessorInBST/inorderSuccessorInBST.java
  class inorderSuccessorInBST (line 36) | public class inorderSuccessorInBST {
    method inorderSuccessor (line 37) | public TreeNode inorderSuccessor(TreeNode root, TreeNode p) {

FILE: algorithms/java/src/inorderSuccessorInBST/inorderSuccessorInBSTTest.java
  class inorderSuccessorInBSTTest (line 12) | public class inorderSuccessorInBSTTest {
    method testInorderSuccessor (line 14) | @Test

FILE: algorithms/java/src/lengthOfLastWord/LengthOfLastWord.java
  class LengthOfLastWord (line 21) | public class LengthOfLastWord {
    method lengthOfLastWord (line 23) | public int lengthOfLastWord(String s) {

FILE: algorithms/java/src/lengthOfLastWord/TestLengthOfLastWord.java
  class TestLengthOfLastWord (line 9) | public class TestLengthOfLastWord {
    method test (line 10) | @Test

FILE: algorithms/java/src/lowestCommonAncestorOfABinaryTree/TreeNode.java
  class TreeNode (line 3) | public class TreeNode {
    method TreeNode (line 7) | TreeNode(int x) { val = x; }

FILE: algorithms/java/src/lowestCommonAncestorOfABinaryTree/lowestCommonAncestorOfABinaryTree.java
  class lowestCommonAncestorOfABinaryTree (line 47) | public class lowestCommonAncestorOfABinaryTree {
    method lowestCommonAncestor (line 53) | public TreeNode lowestCommonAncestor(TreeNode root, TreeNode A, TreeNo...

FILE: algorithms/java/src/lowestCommonAncestorOfABinaryTree/lowestCommonAncestorOfABinaryTreeTest.java
  class lowestCommonAncestorOfABinaryTreeTest (line 12) | public class lowestCommonAncestorOfABinaryTreeTest {
    method testLowestCommonAncestor (line 14) | @Test

FILE: algorithms/java/src/lruCache/LRUCache.java
  class LRUCache (line 15) | public class LRUCache {
    method LRUCache (line 20) | public LRUCache(int capacity) {
    method get (line 25) | public int get(int key) {
    method set (line 35) | public void set(int key, int value) {

FILE: algorithms/java/src/lruCache/LRUCacheTest.java
  class LRUCacheTest (line 6) | public class LRUCacheTest {
    method LRUCacheTest (line 10) | public LRUCacheTest() {
    method testCacheStartsEmpty (line 14) | @Test
    method testSetBelowCapacity (line 19) | @Test
    method testCapacityReachedOldestRemoved (line 29) | @Test
    method testGetRenewsEntry (line 39) | @Test

FILE: algorithms/java/src/maximumDepthOfBinaryTree/TreeNode.java
  class TreeNode (line 3) | public class TreeNode {
    method TreeNode (line 7) | TreeNode(int x) { val = x; }

FILE: algorithms/java/src/maximumDepthOfBinaryTree/maximumDepthOfBinaryTree.java
  class maximumDepthOfBinaryTree (line 27) | public class maximumDepthOfBinaryTree {
    method maxDepth (line 28) | public int maxDepth(TreeNode root) {
    method theDepth (line 35) | private int theDepth(TreeNode root) {

FILE: algorithms/java/src/maximumDepthOfBinaryTree/maximumDepthOfBinaryTreeTest.java
  class maximumDepthOfBinaryTreeTest (line 12) | public class maximumDepthOfBinaryTreeTest {
    method testMaxDepth (line 14) | @Test

FILE: algorithms/java/src/minStack/MinStack.java
  class MinStack (line 27) | public class MinStack {
    method MinStack (line 35) | public MinStack() {
    method push (line 39) | public void push(int x) {
    method pop (line 48) | public void pop() {
    method top (line 53) | public int top() {
    method getMin (line 57) | public int getMin() {

FILE: algorithms/java/src/minStack/TestMinStack.java
  class TestMinStack (line 9) | public class TestMinStack {
    method test (line 10) | @Test

FILE: algorithms/java/src/myQueue/MyQueue.java
  class MyQueue (line 63) | public class MyQueue {
    method MyQueue (line 67) | public MyQueue() {
    method push (line 73) | public void push(int x) {
    method pop (line 78) | public int pop() {
    method peek (line 89) | public int peek() {
    method empty (line 98) | public boolean empty() {

FILE: algorithms/java/src/myQueue/TestMyQueue.java
  class TestMyQueue (line 8) | public class TestMyQueue {
    method test (line 9) | @Test

FILE: algorithms/java/src/myStack/MyStack.java
  class MyStack (line 31) | public class MyStack {
    method MyStack (line 36) | public MyStack() {
    method push (line 43) | public void push(int x) {
    method pop (line 52) | public int pop() {
    method top (line 71) | public int top() {
    method empty (line 91) | public boolean empty() {

FILE: algorithms/java/src/myStack/TestMyStack.java
  class TestMyStack (line 8) | public class TestMyStack {
    method test (line 9) | @Test

FILE: algorithms/java/src/palindromeNumber/PalindromeNumber.java
  class PalindromeNumber (line 23) | public class PalindromeNumber {
    method isPalindrome (line 32) | public boolean isPalindrome(int x) {

FILE: algorithms/java/src/palindromeNumber/TestPalindromeNumber.java
  class TestPalindromeNumber (line 9) | public class TestPalindromeNumber {
    method test (line 10) | @Test

FILE: algorithms/java/src/powXn/PowXn.java
  class PowXn (line 22) | public class PowXn {
    method recursion (line 38) | public double recursion(double x, long n) {
    method myPow01 (line 51) | public double myPow01(double x, int n) {
    method myPow02 (line 65) | public double myPow02(double x, int n) {
    method bitFunction (line 86) | public double bitFunction(double x, long n) {

FILE: algorithms/java/src/powXn/TestPowXn.java
  class TestPowXn (line 9) | public class TestPowXn {
    method test (line 10) | @Test

FILE: algorithms/java/src/removeDuplicatesFromSortedArray/RemoveDuplicatesFromSortedArray.java
  class RemoveDuplicatesFromSortedArray (line 23) | public class RemoveDuplicatesFromSortedArray {
    method removeDuplicates (line 24) | public int removeDuplicates(int[] nums) {

FILE: algorithms/java/src/removeDuplicatesFromSortedArray/TestRemoveDuplicates.java
  class TestRemoveDuplicates (line 9) | public class TestRemoveDuplicates {
    method test (line 10) | @Test
    method assertSorted (line 22) | private void assertSorted(int[] array, int len) {

FILE: algorithms/java/src/reverseLinkedList/ListNode.java
  class ListNode (line 3) | public class ListNode {
    method ListNode (line 6) | public ListNode(int x) {
    method toString (line 9) | @Override
    method ListNode (line 13) | public ListNode(int val, ListNode next) {
    method listToString (line 21) | public static String listToString(ListNode head) {
    method arrayToList (line 37) | public static ListNode arrayToList(int[] array) {

FILE: algorithms/java/src/reverseLinkedList/ReverseLinkedList.java
  class ReverseLinkedList (line 15) | public class ReverseLinkedList {
    method reverseList (line 20) | public ListNode reverse
Condensed preview — 730 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,836K chars).
[
  {
    "path": ".gitignore",
    "chars": 34,
    "preview": ".idea\nalgorithms-java/out\n*.class\n"
  },
  {
    "path": "README.md",
    "chars": 103743,
    "preview": "\nLeetCode\n========\n\n### LeetCode Algorithm\n\n(Notes: \"🔒\" means you need to buy a book from Leetcode)\n\n\n| # | Title | Solu"
  },
  {
    "path": "algorithms/cpp/3Sum/3Sum.cpp",
    "chars": 5331,
    "preview": "// Source : https://oj.leetcode.com/problems/3sum/\n// Author : Hao Chen\n// Date   : 2014-07-22\n\n/***********************"
  },
  {
    "path": "algorithms/cpp/3SumClosest/3SumClosest.cpp",
    "chars": 3158,
    "preview": "// Source : https://oj.leetcode.com/problems/3sum-closest/\n// Author : Hao Chen\n// Date   : 2014-07-03\n\n/***************"
  },
  {
    "path": "algorithms/cpp/4Sum/4Sum.cpp",
    "chars": 3644,
    "preview": "// Source : https://oj.leetcode.com/problems/4sum/\n// Author : Hao Chen\n// Date   : 2014-07-03\n\n/***********************"
  },
  {
    "path": "algorithms/cpp/FindValidMatrixGivenRowAndColumnSums/FindValidMatrixGivenRowAndColumnSums.cpp",
    "chars": 2542,
    "preview": "// Source : https://leetcode.com/problems/find-valid-matrix-given-row-and-column-sums/\n// Author : Sudesh Chaudhary\n// D"
  },
  {
    "path": "algorithms/cpp/LRUCache/LRUCache.cpp",
    "chars": 6125,
    "preview": "// Source : https://oj.leetcode.com/problems/lru-cache/\n// Author : Hao Chen\n// Date   : 2014-10-12\n\n/******************"
  },
  {
    "path": "algorithms/cpp/NumberOfWaysToSplitString/NumberOfWaysToSplitString.cpp",
    "chars": 2302,
    "preview": "// Source : https://leetcode.com/problems/number-of-ways-to-split-a-string/\n// Author : Sudesh Chaudhary\n// Date   : 202"
  },
  {
    "path": "algorithms/cpp/UTF8Validation/UTF8Validation.cpp",
    "chars": 2932,
    "preview": "// Source : https://leetcode.com/problems/utf-8-validation/\n// Author : Hao Chen\n// Date   : 2016-09-08\n\n/**************"
  },
  {
    "path": "algorithms/cpp/accountsMerge/AccountsMerge.cpp",
    "chars": 6706,
    "preview": "// Source : https://leetcode.com/problems/accounts-merge/\n// Author : Hao Chen\n// Date   : 2019-03-29\n\n/****************"
  },
  {
    "path": "algorithms/cpp/addAndSearchWord/AddAndSearchWord.cpp",
    "chars": 4036,
    "preview": "// Source : https://leetcode.com/problems/add-and-search-word-data-structure-design/\n// Author : Hao Chen\n// Date   : 20"
  },
  {
    "path": "algorithms/cpp/addBinary/addBinary.cpp",
    "chars": 1207,
    "preview": "// Source : https://oj.leetcode.com/problems/add-binary/\n// Author : Hao Chen\n// Date   : 2014-07-05\n\n/*****************"
  },
  {
    "path": "algorithms/cpp/addDigits/addDigits.cpp",
    "chars": 2642,
    "preview": "// Source : https://leetcode.com/problems/add-digits/\n// Author : Timothy Lim, Hao Chen\n// Date   : 2015-10-1\n\n/********"
  },
  {
    "path": "algorithms/cpp/addStrings/AddStrings.cpp",
    "chars": 1497,
    "preview": "// Source : https://leetcode.com/problems/add-strings/\n// Author : Hao Chen\n// Date   : 2016-11-12\n\n/*******************"
  },
  {
    "path": "algorithms/cpp/addToArrayFormOfInteger/AddToArrayFormOfInteger.cpp",
    "chars": 1590,
    "preview": "// Source : https://leetcode.com/problems/add-to-array-form-of-integer/\n// Author : Hao Chen\n// Date   : 2019-03-25\n\n/**"
  },
  {
    "path": "algorithms/cpp/addTwoNumbers/addTwoNumbers.cpp",
    "chars": 1575,
    "preview": "// Source : https://oj.leetcode.com/problems/add-two-numbers/\n// Author : Hao Chen\n// Date   : 2014-06-18\n\n/************"
  },
  {
    "path": "algorithms/cpp/additiveNumber/AdditiveNumber.cpp",
    "chars": 2952,
    "preview": "// Source : https://leetcode.com/problems/additive-number/\n// Author : Hao Chen\n// Date   : 2015-11-22\n\n/***************"
  },
  {
    "path": "algorithms/cpp/anagrams/GroupAnagrams.cpp",
    "chars": 2888,
    "preview": "// Source : https://oj.leetcode.com/problems/anagrams/\n// Author : Hao Chen\n// Date   : 2014-07-18\n\n/*******************"
  },
  {
    "path": "algorithms/cpp/anagrams/ValidAnagram.cpp",
    "chars": 1567,
    "preview": "// Source : https://leetcode.com/problems/valid-anagram/\n// Author : Hao Chen\n// Date   : 2015-08-16\n\n/*****************"
  },
  {
    "path": "algorithms/cpp/arithmeticSlices/ArithmeticSlices.cpp",
    "chars": 2444,
    "preview": "// Source : https://leetcode.com/problems/arithmetic-slices/\n// Author : Hao Chen\n// Date   : 2016-11-13\n\n/*************"
  },
  {
    "path": "algorithms/cpp/backspaceStringCompare/BackspaceStringCompare.cpp",
    "chars": 1648,
    "preview": "// Source : https://leetcode.com/problems/backspace-string-compare/description/\n// Author : Hao Chen\n// Date   : 2018-06"
  },
  {
    "path": "algorithms/cpp/balancedBinaryTree/balancedBinaryTree.cpp",
    "chars": 2008,
    "preview": "// Source : https://oj.leetcode.com/problems/balanced-binary-tree/\n// Author : Hao Chen\n// Date   : 2014-06-28\n\n/*******"
  },
  {
    "path": "algorithms/cpp/basicCalculator/BasicCalculator.II.cpp",
    "chars": 2964,
    "preview": "// Source : https://leetcode.com/problems/basic-calculator-ii/\n// Author : Hao Chen\n// Date   : 2015-06-24\n\n/***********"
  },
  {
    "path": "algorithms/cpp/basicCalculator/BasicCalculator.cpp",
    "chars": 8557,
    "preview": "// Source : https://leetcode.com/problems/basic-calculator/\n// Author : Hao Chen\n// Date   : 2015-06-12\n\n/**************"
  },
  {
    "path": "algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithCooldown.cpp",
    "chars": 2354,
    "preview": "// Source : https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/\n// Author : Hao Chen\n// Date   "
  },
  {
    "path": "algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithTransactionFee.cpp",
    "chars": 7900,
    "preview": "// Source : https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee\n// Author : Hao Chen\n// D"
  },
  {
    "path": "algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp",
    "chars": 2674,
    "preview": "// Source : https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/\n// Author : Hao Chen\n// Date   : 2014-0"
  },
  {
    "path": "algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp",
    "chars": 2846,
    "preview": "// Source : https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/\n// Author : Hao Chen\n// Date   : 2014-"
  },
  {
    "path": "algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp",
    "chars": 5299,
    "preview": "// Source : https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/\n// Author : Hao Chen\n// Date   : 2015-03-3"
  },
  {
    "path": "algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp",
    "chars": 2482,
    "preview": "// Source : https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/\n// Author : Hao Chen\n// Date   : 2014-06-1"
  },
  {
    "path": "algorithms/cpp/binarySearchTreeIterator/binarySearchTreeIterator.cpp",
    "chars": 1594,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-search-tree-iterator/\n// Author : Hao Chen\n// Date   : 2014-12-31\n\n/"
  },
  {
    "path": "algorithms/cpp/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp",
    "chars": 1757,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-inorder-traversal/\n// Author : Hao Chen\n// Date   : 2014-06-27\n"
  },
  {
    "path": "algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp",
    "chars": 2405,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/\n// Author : Hao Chen\n// Date   : 2014"
  },
  {
    "path": "algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp",
    "chars": 6075,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-level-order-traversal/\n// Author : Hao Chen\n// Date   : 2014-07"
  },
  {
    "path": "algorithms/cpp/binaryTreeMaximumPathSum/binaryTreeMaximumPathSum.cpp",
    "chars": 1804,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/\n// Author : Hao Chen\n// Date   : 2014-10-10\n\n"
  },
  {
    "path": "algorithms/cpp/binaryTreePaths/binaryTreePaths.cpp",
    "chars": 2600,
    "preview": "// Source : https://leetcode.com/problems/binary-tree-paths/\n// Author : Calinescu Valentin, Hao Chen\n// Date   : 2015-1"
  },
  {
    "path": "algorithms/cpp/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp",
    "chars": 3829,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-postorder-traversal/\n// Author : Hao Chen\n// Date   : 2014-07-2"
  },
  {
    "path": "algorithms/cpp/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp",
    "chars": 3173,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-preorder-traversal/\n// Author : Hao Chen\n// Date   : 2014-07-21"
  },
  {
    "path": "algorithms/cpp/binaryTreeRightSideView/binaryTreeRightSideView.cpp",
    "chars": 2254,
    "preview": "// Source : https://leetcode.com/problems/binary-tree-right-side-view/\n// Author : Hao Chen\n// Date   : 2015-04-07\n\n/***"
  },
  {
    "path": "algorithms/cpp/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp",
    "chars": 1873,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-upside-down/\n// Author : Hao Chen\n// Date   : 2014-11-17\n\n/****"
  },
  {
    "path": "algorithms/cpp/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp",
    "chars": 4974,
    "preview": "// Source : https://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/\n// Author : Hao Chen\n// Date   : "
  },
  {
    "path": "algorithms/cpp/binaryWatch/BinaryWatch.cpp",
    "chars": 3442,
    "preview": "// Source : https://leetcode.com/problems/binary-watch/\n// Author : Hao Chen\n// Date   : 2016-11-05\n\n/******************"
  },
  {
    "path": "algorithms/cpp/bitwiseANDOfNumbersRange/BitwiseAndOfNumbersRange.cpp",
    "chars": 1713,
    "preview": "// Source : https://leetcode.com/problems/bitwise-and-of-numbers-range/\n// Author : Hao Chen\n// Date   : 2015-06-08\n\n/**"
  },
  {
    "path": "algorithms/cpp/brokenCalculator/BrokenCalculator.cpp",
    "chars": 1433,
    "preview": "// Source : https://leetcode.com/problems/broken-calculator/\n// Author : Hao Chen\n// Date   : 2019-05-01\n\n/*************"
  },
  {
    "path": "algorithms/cpp/buddyStrings/BuddyStrings.cpp",
    "chars": 1764,
    "preview": "// Source : https://leetcode.com/problems/buddy-strings/description/\n// Author : Hao Chen\n// Date   : 2018-06-27\n\n/*****"
  },
  {
    "path": "algorithms/cpp/buildingBoxes/BuildingBoxes.cpp",
    "chars": 3813,
    "preview": "// Source : https://leetcode.com/problems/building-boxes/\n// Author : Hao Chen\n// Date   : 2021-04-09\n\n/****************"
  },
  {
    "path": "algorithms/cpp/bulbSwitcher/BulbSwitcher.II.cpp",
    "chars": 2573,
    "preview": "// Source : https://leetcode.com/problems/bulb-switcher-ii/\n// Author : Hao Chen\n// Date   : 2021-03-29\n\n/**************"
  },
  {
    "path": "algorithms/cpp/bulbSwitcher/BulbSwitcher.III.cpp",
    "chars": 1993,
    "preview": "// Source : https://leetcode.com/problems/bulb-switcher-iii\n// Author : Hao Chen\n// Date   : 2021-03-29\n\n/**************"
  },
  {
    "path": "algorithms/cpp/bulbSwitcher/BulbSwitcher.IV.cpp",
    "chars": 1945,
    "preview": "// Source : https://leetcode.com/problems/bulb-switcher-iv/\n// Author : Hao Chen\n// Date   : 2021-03-29\n\n/**************"
  },
  {
    "path": "algorithms/cpp/bulbSwitcher/bulbSwitcher.cpp",
    "chars": 2886,
    "preview": "// Source : https://leetcode.com/problems/bulb-switcher/\n// Author : Calinescu Valentin, Hao Chen\n// Date   : 2015-12-28"
  },
  {
    "path": "algorithms/cpp/bullsAndCows/bullsAndCows.cpp",
    "chars": 3419,
    "preview": "// Source : https://leetcode.com/problems/bulls-and-cows/\n// Author : Calinescu Valentin, Hao Chen\n// Date   : 2015-11-0"
  },
  {
    "path": "algorithms/cpp/burstBalloons/BurstBalloons.cpp",
    "chars": 3551,
    "preview": "// Source : https://leetcode.com/problems/burst-balloons/\n// Author : Hao Chen\n// Date   : 2016-01-17\n\n/****************"
  },
  {
    "path": "algorithms/cpp/calculateMoneyInLeetcodeBank/CalculateMoneyInLeetcodeBank.cpp",
    "chars": 2087,
    "preview": "// Source : https://leetcode.com/problems/calculate-money-in-leetcode-bank/\n// Author : Hao Chen\n// Date   : 2021-03-28\n"
  },
  {
    "path": "algorithms/cpp/candy/candy.cpp",
    "chars": 3059,
    "preview": "// Source : https://oj.leetcode.com/problems/candy/\n// Author : Hao Chen\n// Date   : 2014-10-12\n\n/**********************"
  },
  {
    "path": "algorithms/cpp/checkIfArrayIsSortedAndRotated/CheckIfArrayIsSortedAndRotated.cpp",
    "chars": 2273,
    "preview": "// Source : https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/\n// Author : Hao Chen\n// Date   : 2021-02"
  },
  {
    "path": "algorithms/cpp/checkIfBinaryStringHasAtMostOneSegmentOfOnes/CheckIfBinaryStringHasAtMostOneSegmentOfOnes.cpp",
    "chars": 1024,
    "preview": "// Source : https://leetcode.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones/\n// Author : Hao Chen\n/"
  },
  {
    "path": "algorithms/cpp/checkIfNumberIsASumOfPowersOfThree/CheckIfNumberIsASumOfPowersOfThree.cpp",
    "chars": 1781,
    "preview": "// Source : https://leetcode.com/problems/check-if-number-is-a-sum-of-powers-of-three/\n// Author : Hao Chen\n// Date   : "
  },
  {
    "path": "algorithms/cpp/checkIfOneStringSwapCanMakeStringsEqual/CheckIfOneStringSwapCanMakeStringsEqual.cpp",
    "chars": 1796,
    "preview": "// Source : https://leetcode.com/problems/check-if-one-string-swap-can-make-strings-equal/\n// Author : Hao Chen\n// Date "
  },
  {
    "path": "algorithms/cpp/checkIfTheSentenceIsPangram/CheckIfTheSentenceIsPangram.cpp",
    "chars": 1210,
    "preview": "// Source : https://leetcode.com/problems/check-if-the-sentence-is-pangram/\n// Author : Hao Chen\n// Date   : 2021-04-20\n"
  },
  {
    "path": "algorithms/cpp/checkIfWordEqualsSummationOfTwoWords/CheckIfWordEqualsSummationOfTwoWords.cpp",
    "chars": 2665,
    "preview": "// Source : https://leetcode.com/problems/check-if-word-equals-summation-of-two-words/\n// Author : Hao Chen\n// Date   : "
  },
  {
    "path": "algorithms/cpp/climbStairs/climbStairs.cpp",
    "chars": 865,
    "preview": "// Source : https://oj.leetcode.com/problems/climbing-stairs/\n// Author : Hao Chen\n// Date   : 2014-06-27\n\n/************"
  },
  {
    "path": "algorithms/cpp/cloneGraph/cloneGraph.cpp",
    "chars": 2759,
    "preview": "// Source : https://oj.leetcode.com/problems/clone-graph/\n// Author : Hao Chen\n// Date   : 2014-10-12\n\n/****************"
  },
  {
    "path": "algorithms/cpp/closestDessertCost/ClosestDessertCost.cpp",
    "chars": 3782,
    "preview": "// Source : https://leetcode.com/problems/closest-dessert-cost/\n// Author : Hao Chen\n// Date   : 2021-03-14\n\n/**********"
  },
  {
    "path": "algorithms/cpp/closestRoom/ClosestRoom.cpp",
    "chars": 4090,
    "preview": "// Source : https://leetcode.com/problems/closest-room/\n// Author : Hao Chen\n// Date   : 2021-05-03\n\n/******************"
  },
  {
    "path": "algorithms/cpp/closestSubsequenceSum/ClosestSubsequenceSum.cpp",
    "chars": 3670,
    "preview": "// Source : https://leetcode.com/problems/closest-subsequence-sum/\n// Author : Hao Chen\n// Date   : 2021-02-15\n\n/*******"
  },
  {
    "path": "algorithms/cpp/coinChange/CoinChange2.cpp",
    "chars": 2319,
    "preview": "// Source : https://leetcode.com/problems/coin-change-2/\n// Author : Hao Chen\n// Date   : 2019-03-18\n\n/*****************"
  },
  {
    "path": "algorithms/cpp/coinChange/coinChange.cpp",
    "chars": 3354,
    "preview": "// Source : https://leetcode.com/problems/coin-change/\n// Author : Calinescu Valentin, Hao Chen\n// Date   : 2015-12-28\n\n"
  },
  {
    "path": "algorithms/cpp/combinationSum/combinationSum.II.cpp",
    "chars": 2849,
    "preview": "// Source : https://oj.leetcode.com/problems/combination-sum-ii/\n// Author : Hao Chen\n// Date   : 2014-07-19\n\n/*********"
  },
  {
    "path": "algorithms/cpp/combinationSum/combinationSum.III.cpp",
    "chars": 2384,
    "preview": "// Source : https://leetcode.com/problems/combination-sum-iii/\n// Author : Hao Chen\n// Date   : 2015-06-11\n\n/***********"
  },
  {
    "path": "algorithms/cpp/combinationSum/combinationSum.cpp",
    "chars": 2563,
    "preview": "// Source : https://oj.leetcode.com/problems/combination-sum/\n// Author : Hao Chen\n// Date   : 2014-07-19\n\n/************"
  },
  {
    "path": "algorithms/cpp/combinationSumIV/combinationSumIV.cpp",
    "chars": 2466,
    "preview": "// Source : https://leetcode.com/problems/combination-sum-iv/\n// Author : Calinescu Valentin\n// Date   : 2016-08-07\n\n/**"
  },
  {
    "path": "algorithms/cpp/combinations/combinations.cpp",
    "chars": 3247,
    "preview": "// Source : https://oj.leetcode.com/problems/combinations/\n// Author : Hao Chen\n// Date   : 2014-07-03\n\n/***************"
  },
  {
    "path": "algorithms/cpp/compareStringsByFrequencyOfTheSmallestCharacter/CompareStringsByFrequencyOfTheSmallestCharacter.cpp",
    "chars": 2686,
    "preview": "// Source : https://leetcode.com/problems/compare-strings-by-frequency-of-the-smallest-character/\n// Author : Hao Chen\n/"
  },
  {
    "path": "algorithms/cpp/compareVersionNumbers/compareVersionNumbers.cpp",
    "chars": 2517,
    "preview": "// Source : https://oj.leetcode.com/problems/compare-version-numbers/\n// Author : Hao Chen\n// Date   : 2014-12-16\n\n/****"
  },
  {
    "path": "algorithms/cpp/constructBinaryTreeFromInorderAndPostorderTraversal/constructBinaryTreeFromInorderAndPostorderTraversal.cpp",
    "chars": 4118,
    "preview": "// Source : https://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/\n// Author : Hao"
  },
  {
    "path": "algorithms/cpp/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp",
    "chars": 3024,
    "preview": "// Source : https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/\n// Author : Hao "
  },
  {
    "path": "algorithms/cpp/constructTheLexicographicallyLargestValidSequence/ConstructTheLexicographicallyLargestValidSequence.cpp",
    "chars": 3345,
    "preview": "// Source : https://leetcode.com/problems/construct-the-lexicographically-largest-valid-sequence/\n// Author : Hao Chen\n/"
  },
  {
    "path": "algorithms/cpp/containerWithMostWater/containerWithMostWater.cpp",
    "chars": 1906,
    "preview": "// Source : https://oj.leetcode.com/problems/container-with-most-water/\n// Author : Hao Chen\n// Date   : 2014-06-22\n\n/**"
  },
  {
    "path": "algorithms/cpp/containsDuplicate/ContainsDuplicate.II.cpp",
    "chars": 873,
    "preview": "// Source : https://leetcode.com/problems/contains-duplicate-ii/\n// Author : Hao Chen\n// Date   : 2015-06-12\n\n/*********"
  },
  {
    "path": "algorithms/cpp/containsDuplicate/ContainsDuplicate.III.cpp",
    "chars": 1379,
    "preview": "// Source : https://leetcode.com/problems/contains-duplicate-iii/\n// Author : Hao Chen\n// Date   : 2015-06-12\n\n/********"
  },
  {
    "path": "algorithms/cpp/containsDuplicate/ContainsDuplicate.cpp",
    "chars": 786,
    "preview": "// Source : https://leetcode.com/problems/contains-duplicate/\n// Author : Hao Chen\n// Date   : 2015-06-11\n\n/************"
  },
  {
    "path": "algorithms/cpp/convertANumberToHexadecimal/ConvertANumberToHexadecimal.cpp",
    "chars": 1448,
    "preview": "// Source : https://leetcode.com/problems/convert-a-number-to-hexadecimal/\n// Author : Hao Chen\n// Date   : 2016-11-12\n\n"
  },
  {
    "path": "algorithms/cpp/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp",
    "chars": 1436,
    "preview": "// Source : https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/\n// Author : Hao Chen\n// Date   "
  },
  {
    "path": "algorithms/cpp/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp",
    "chars": 2558,
    "preview": "// Source : https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/\n// Author : Hao Chen\n// Date   :"
  },
  {
    "path": "algorithms/cpp/copyListWithRandomPointer/copyListWithRandomPointer.cpp",
    "chars": 5429,
    "preview": "// Source : https://oj.leetcode.com/problems/copy-list-with-random-pointer/\n// Author : Hao Chen\n// Date   : 2014-06-18\n"
  },
  {
    "path": "algorithms/cpp/countAndSay/countAndSay.cpp",
    "chars": 1852,
    "preview": "// Source : https://oj.leetcode.com/problems/count-and-say/\n// Author : Hao Chen\n// Date   : 2014-07-03\n\n/**************"
  },
  {
    "path": "algorithms/cpp/countCompleteTreeNodes/CountCompleteTreeNodes.cpp",
    "chars": 1576,
    "preview": "// Source : https://leetcode.com/problems/count-complete-tree-nodes/\n// Author : Hao Chen\n// Date   : 2015-06-12\n\n/*****"
  },
  {
    "path": "algorithms/cpp/countGoodMeals/CountGoodMeals.cpp",
    "chars": 2190,
    "preview": "// Source : https://leetcode.com/problems/count-good-meals/\n// Author : Hao Chen\n// Date   : 2021-03-30\n\n/**************"
  },
  {
    "path": "algorithms/cpp/countItemsMatchingARule/CountItemsMatchingARule.cpp",
    "chars": 2203,
    "preview": "// Source : https://leetcode.com/problems/count-items-matching-a-rule/\n// Author : Hao Chen\n// Date   : 2021-03-14\n\n/***"
  },
  {
    "path": "algorithms/cpp/countNicePairsInAnArray/CountNicePairsInAnArray.cpp",
    "chars": 2504,
    "preview": "// Source : https://leetcode.com/problems/count-nice-pairs-in-an-array/\n// Author : Hao Chen\n// Date   : 2021-04-06\n\n/**"
  },
  {
    "path": "algorithms/cpp/countNumberOfHomogenousSubstrings/CountNumberOfHomogenousSubstrings.cpp",
    "chars": 1759,
    "preview": "// Source : https://leetcode.com/problems/count-number-of-homogenous-substrings/\n// Author : Hao Chen\n// Date   : 2021-0"
  },
  {
    "path": "algorithms/cpp/countNumbersWithUniqueDigits/CountNumbersWithUniqueDigits.cpp",
    "chars": 1962,
    "preview": "// Source : https://leetcode.com/problems/count-numbers-with-unique-digits/\n// Author : Hao Chen\n// Date   : 2019-03-24\n"
  },
  {
    "path": "algorithms/cpp/countOddNumbersInAnIntervalRange/CountOddNumbersInAnIntervalRange.cpp",
    "chars": 1229,
    "preview": "// Source : https://leetcode.com/problems/count-odd-numbers-in-an-interval-range/\n// Author : Hao Chen\n// Date   : 2020-"
  },
  {
    "path": "algorithms/cpp/countOfRangeSum/CountOfRangeSum.cpp",
    "chars": 5343,
    "preview": "// Source : https://leetcode.com/problems/count-of-range-sum/\n// Author : Hao Chen\n// Date   : 2016-01-15\n\n/************"
  },
  {
    "path": "algorithms/cpp/countOfSmallerNumbersAfterSelf/countOfSmallerNumbersAfterSelf.cpp",
    "chars": 4807,
    "preview": "// Source : https://leetcode.com/problems/count-of-smaller-numbers-after-self/\n// Author : Calinescu Valentin, Hao Chen\n"
  },
  {
    "path": "algorithms/cpp/countPairsOfNodes/CountPairsOfNodes.cpp",
    "chars": 4878,
    "preview": "// Source : https://leetcode.com/problems/count-pairs-of-nodes/\n// Author : Hao Chen\n// Date   : 2021-03-23\n\n/**********"
  },
  {
    "path": "algorithms/cpp/countPairsWithXorInARange/CountPairsWithXorInARange.cpp",
    "chars": 6008,
    "preview": "// Source : https://leetcode.com/problems/count-pairs-with-xor-in-a-range/\n// Author : Hao Chen\n// Date   : 2021-03-21\n\n"
  },
  {
    "path": "algorithms/cpp/countPrimes/CountPrimes.cpp",
    "chars": 5840,
    "preview": "// Source : https://leetcode.com/problems/count-primes/\n// Author : Hao Chen\n// Date   : 2015-06-09\n\n/******************"
  },
  {
    "path": "algorithms/cpp/countingBits/CountingBits.cpp",
    "chars": 2491,
    "preview": "// Source : https://leetcode.com/problems/counting-bits/\n// Author : Hao Chen\n// Date   : 2016-05-30\n\n/*****************"
  },
  {
    "path": "algorithms/cpp/courseSchedule/CourseSchedule.II.cpp",
    "chars": 3963,
    "preview": "// Source : https://leetcode.com/problems/course-schedule-ii/\n// Author : Hao Chen\n// Date   : 2015-06-10\n\n/************"
  },
  {
    "path": "algorithms/cpp/courseSchedule/CourseSchedule.cpp",
    "chars": 3256,
    "preview": "// Source : https://leetcode.com/problems/course-schedule/\n// Author : Hao Chen\n// Date   : 2015-06-09\n\n/***************"
  },
  {
    "path": "algorithms/cpp/courseSchedule/non-recursive/course_schedule.cpp",
    "chars": 5015,
    "preview": "//\n//  course_schedule.cpp\n//  LeeteCodeOJ#207\n//\n//  Created by Wang Yi on 28/11/16.\n//  Copyright (c) 2016 Wang Yi. Al"
  },
  {
    "path": "algorithms/cpp/courseSchedule/non-recursive/main.cpp",
    "chars": 686,
    "preview": "//\n//  main.cpp\n//  LeeteCodeOJ#207\n//\n//  Created by Wang Yi on 28/11/16.\n//  Copyright (c) 2016 Wang Yi. All rights re"
  },
  {
    "path": "algorithms/cpp/cousinsInBinaryTree/CousinsInBinaryTree.cpp",
    "chars": 2087,
    "preview": "// Source : https://leetcode.com/problems/cousins-in-binary-tree/\n// Author : Hao Chen\n// Date   : 2019-04-30\n\n/********"
  },
  {
    "path": "algorithms/cpp/createMaximumNumber/CreateMaximumNumber.cpp",
    "chars": 4815,
    "preview": "// Source : https://leetcode.com/problems/create-maximum-number/\n// Author : Hao Chen\n// Date   : 2016-01-21\n\n/*********"
  },
  {
    "path": "algorithms/cpp/decodeString/DecodeString.cpp",
    "chars": 3023,
    "preview": "// Source : https://leetcode.com/problems/decode-string/\n// Author : Hao Chen\n// Date   : 2016-09-08\n\n/*****************"
  },
  {
    "path": "algorithms/cpp/decodeWays/decodeWays.cpp",
    "chars": 1887,
    "preview": "// Source : https://oj.leetcode.com/problems/decode-ways/\n// Author : Hao Chen\n// Date   : 2014-07-16\n\n/****************"
  },
  {
    "path": "algorithms/cpp/decodeXORedPermutation/DecodeXoredPermutation.cpp",
    "chars": 3386,
    "preview": "// Source : https://leetcode.com/problems/decode-xored-permutation/\n// Author : Hao Chen\n// Date   : 2021-02-17\n\n/******"
  },
  {
    "path": "algorithms/cpp/deleteNodeInALinkedList/DeleteNodeInALinkedList.cpp",
    "chars": 1023,
    "preview": "// Source : https://leetcode.com/problems/delete-node-in-a-linked-list/\n// Author : Hao Chen\n// Date   : 2015-07-17\n\n/**"
  },
  {
    "path": "algorithms/cpp/designAuthenticationManager/DesignAuthenticationManager.cpp",
    "chars": 4804,
    "preview": "// Source : https://leetcode.com/problems/design-authentication-manager/\n// Author : Hao Chen\n// Date   : 2021-03-22\n\n/*"
  },
  {
    "path": "algorithms/cpp/detectCapital/DetectCapital.cpp",
    "chars": 1603,
    "preview": "// Source : https://leetcode.com/problems/detect-capital/\n// Author : Hao Chen\n// Date   : 2019-02-04\n\n/****************"
  },
  {
    "path": "algorithms/cpp/determineColorOfAChessboardSquare/DetermineColorOfAChessboardSquare.cpp",
    "chars": 1393,
    "preview": "// Source : https://leetcode.com/problems/determine-color-of-a-chessboard-square/\n// Author : Hao Chen\n// Date   : 2021-"
  },
  {
    "path": "algorithms/cpp/diameterOfBinaryTree/diameterOfBinaryTree.cpp",
    "chars": 914,
    "preview": "// Source : https://leetcode.com/problems/add-and-search-word-data-structure-design/\n// Author : Arshdeep Singh\n// Date "
  },
  {
    "path": "algorithms/cpp/differentWaysToAddParentheses/DifferentWaysToAddParentheses.cpp",
    "chars": 3002,
    "preview": "// Source : https://leetcode.com/problems/different-ways-to-add-parentheses/\n// Author : Hao Chen\n// Date   : 2015-08-15"
  },
  {
    "path": "algorithms/cpp/distinctSubsequences/distinctSubsequences.cpp",
    "chars": 5111,
    "preview": "// Source : https://oj.leetcode.com/problems/distinct-subsequences/\n// Author : Hao Chen\n// Date   : 2014-07-06\n\n/******"
  },
  {
    "path": "algorithms/cpp/distributeCoinsInBinaryTree/DistributeCoinsInBinaryTree.cpp",
    "chars": 2767,
    "preview": "// Source : https://leetcode.com/problems/distribute-coins-in-binary-tree/\n// Author : Hao Chen\n// Date   : 2019-03-29\n\n"
  },
  {
    "path": "algorithms/cpp/divideTwoInt/divideTwoInt.cpp",
    "chars": 2310,
    "preview": "// Source : https://oj.leetcode.com/problems/divide-two-integers/\n// Author : Hao Chen\n// Date   : 2014-06-20\n\n/********"
  },
  {
    "path": "algorithms/cpp/dungeonGame/dungeonGame.cpp",
    "chars": 3602,
    "preview": "// Source : https://oj.leetcode.com/problems/dungeon-game/\n// Author : Hao Chen\n// Date   : 2015-01-16\n\n/***************"
  },
  {
    "path": "algorithms/cpp/editDistance/editDistance.cpp",
    "chars": 3851,
    "preview": "// Source : https://oj.leetcode.com/problems/edit-distance/\n// Author : Hao Chen\n// Date   : 2014-08-22\n\n/**************"
  },
  {
    "path": "algorithms/cpp/eggDropWith2EggsAndNFloors/EggDropWith2EggsAndNFloors.cpp",
    "chars": 2679,
    "preview": "// Source : https://leetcode.com/problems/egg-drop-with-2-eggs-and-n-floors/\n// Author : Hao Chen\n// Date   : 2021-11-15"
  },
  {
    "path": "algorithms/cpp/eliminationGame/EliminationGame.cpp",
    "chars": 1155,
    "preview": "// Source : https://leetcode.com/problems/elimination-game\n// Author : Hao Chen\n// Date   : 2016-09-07-\n\n/**************"
  },
  {
    "path": "algorithms/cpp/equalSumArraysWithMinimumNumberOfOperations/EqualSumArraysWithMinimumNumberOfOperations.cpp",
    "chars": 4833,
    "preview": "// Source : https://leetcode.com/problems/equal-sum-arrays-with-minimum-number-of-operations/\n// Author : Hao Chen\n// Da"
  },
  {
    "path": "algorithms/cpp/evaluateDivision/EvaluateDivision.cpp",
    "chars": 3366,
    "preview": "// Source : https://leetcode.com/problems/evaluate-division/\n// Author : Hao Chen\n// Date   : 2016-11-05\n\n/*************"
  },
  {
    "path": "algorithms/cpp/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp",
    "chars": 2894,
    "preview": "// Source : https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/\n// Author : Hao Chen\n// Date   : 2014-06-"
  },
  {
    "path": "algorithms/cpp/evaluateTheBracketPairsOfAString/EvaluateTheBracketPairsOfAString.cpp",
    "chars": 3740,
    "preview": "// Source : https://leetcode.com/problems/evaluate-the-bracket-pairs-of-a-string/\n// Author : Hao Chen\n// Date   : 2021-"
  },
  {
    "path": "algorithms/cpp/excelSheetColumnNumber/excelSheetColumnNumber.cpp",
    "chars": 1544,
    "preview": "// Source : https://oj.leetcode.com/problems/excel-sheet-column-number/\n// Author : Hao Chen\n// Date   : 2014-12-29\n\n/**"
  },
  {
    "path": "algorithms/cpp/excelSheetColumnTitle/excelSheetColumnTitle.cpp",
    "chars": 1507,
    "preview": "// Source : https://oj.leetcode.com/problems/excel-sheet-column-title/\n// Author : Hao Chen\n// Date   : 2014-12-25\n\n/***"
  },
  {
    "path": "algorithms/cpp/expressionAddOperators/ExpressionAddOperators.cpp",
    "chars": 3363,
    "preview": "// Source : https://leetcode.com/problems/expression-add-operators/\n// Author : Hao Chen\n// Date   : 2016-01-16\n\n/******"
  },
  {
    "path": "algorithms/cpp/factorialTrailingZeroes/factorialTrailingZeroes.cpp",
    "chars": 2853,
    "preview": "// Source : https://oj.leetcode.com/problems/factorial-trailing-zeroes/\n// Author : Hao Chen\n// Date   : 2014-12-30\n\n/**"
  },
  {
    "path": "algorithms/cpp/fibonacciNumber/FibonacciNumber.cpp",
    "chars": 1190,
    "preview": "// Source : https://leetcode.com/problems/fibonacci-number/\n// Author : Hao Chen\n// Date   : 2019-03-26\n\n/**************"
  },
  {
    "path": "algorithms/cpp/filterRestaurantsByVeganFriendlyPriceAndDistance/FilterRestaurantsByVeganFriendlyPriceAndDistance.cpp",
    "chars": 3538,
    "preview": "// Source : https://leetcode.com/problems/filter-restaurants-by-vegan-friendly-price-and-distance/\n// Author : Sharvil K"
  },
  {
    "path": "algorithms/cpp/findAllAnagramsInAString/Find-All-Anagrams-in-a-String.cpp",
    "chars": 1725,
    "preview": "// Source : https://leetcode.com/problems/find-all-anagrams-in-a-string/\n// Author : Manu Gond\n// Date   : 2019-10-06\n\n/"
  },
  {
    "path": "algorithms/cpp/findCenterOfStarGraph/FindCenterOfStarGraph.cpp",
    "chars": 1172,
    "preview": "// Source : https://leetcode.com/problems/find-center-of-star-graph/\n// Author : Hao Chen\n// Date   : 2021-03-19\n\n/*****"
  },
  {
    "path": "algorithms/cpp/findKthLargestXorCoordinateValue/FindKthLargestXorCoordinateValue.cpp",
    "chars": 2922,
    "preview": "// Source : https://leetcode.com/problems/find-kth-largest-xor-coordinate-value/\n// Author : Hao Chen\n// Date   : 2021-0"
  },
  {
    "path": "algorithms/cpp/findMedianFromDataStream/FindMedianFromDataStream.cpp",
    "chars": 2109,
    "preview": "// Source : https://leetcode.com/problems/find-median-from-data-stream/\n// Author : Hao Chen\n// Date   : 2015-11-14\n\n/**"
  },
  {
    "path": "algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp",
    "chars": 3504,
    "preview": "// Source : https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/\n// Author : Hao Chen\n// Date   : 2"
  },
  {
    "path": "algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp",
    "chars": 3184,
    "preview": "// Source : https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array/\n// Author : Hao Chen\n// Date   : 2014"
  },
  {
    "path": "algorithms/cpp/findNearestPointThatHasTheSameXOrYCoordinate/FindNearestPointThatHasTheSameXOrYCoordinate.cpp",
    "chars": 2261,
    "preview": "// Source : https://leetcode.com/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate/\n// Author : Hao Chen\n/"
  },
  {
    "path": "algorithms/cpp/findPeakElement/findPeakElement.cpp",
    "chars": 3300,
    "preview": "// Source : https://oj.leetcode.com/problems/find-peak-element/\n// Author : Hao Chen\n// Date   : 2014-12-05\n\n/**********"
  },
  {
    "path": "algorithms/cpp/findTheDifference/FindTheDifference.cpp",
    "chars": 919,
    "preview": "// Source : https://leetcode.com/problems/find-the-difference/\n// Author : Hao Chen\n// Date   : 2016-09-08\n\n/***********"
  },
  {
    "path": "algorithms/cpp/findTheDuplicateNumber/findTheDuplicateNumber.cpp",
    "chars": 1656,
    "preview": "// Source : https://leetcode.com/problems/find-the-duplicate-number/\n// Author : Hao Chen, Calinescu Valentin\n// Date   "
  },
  {
    "path": "algorithms/cpp/findTheHighestAltitude/FindTheHighestAltitude.cpp",
    "chars": 1318,
    "preview": "// Source : https://leetcode.com/problems/find-the-highest-altitude/\n// Author : Hao Chen\n// Date   : 2021-02-17\n\n/*****"
  },
  {
    "path": "algorithms/cpp/findTheWinnerOfAnArrayGame/FindTheWinnerOfAnArrayGame.cpp",
    "chars": 2902,
    "preview": "// Source : https://leetcode.com/problems/find-the-winner-of-an-array-game/\n// Author : Hao Chen\n// Date   : 2020-10-02\n"
  },
  {
    "path": "algorithms/cpp/findTheWinnerOfTheCircularGame/FindTheWinnerOfTheCircularGame.cpp",
    "chars": 2477,
    "preview": "// Source : https://leetcode.com/problems/find-the-winner-of-the-circular-game/\n// Author : Hao Chen\n// Date   : 2021-04"
  },
  {
    "path": "algorithms/cpp/findXorSumOfAllPairsBitwiseAnd/FindXorSumOfAllPairsBitwiseAnd.cpp",
    "chars": 1722,
    "preview": "// Source : https://leetcode.com/problems/find-xor-sum-of-all-pairs-bitwise-and/\n// Author : Hao Chen\n// Date   : 2021-0"
  },
  {
    "path": "algorithms/cpp/findingMkAverage/FindingMkAverage.cpp",
    "chars": 7864,
    "preview": "// Source : https://leetcode.com/problems/finding-mk-average/\n// Author : Hao Chen\n// Date   : 2021-04-20\n\n/************"
  },
  {
    "path": "algorithms/cpp/findingTheUsersActiveMinutes/FindingTheUsersActiveMinutes.cpp",
    "chars": 2580,
    "preview": "// Source : https://leetcode.com/problems/finding-the-users-active-minutes/\n// Author : Hao Chen\n// Date   : 2021-04-05\n"
  },
  {
    "path": "algorithms/cpp/firstBadVersion/FirstBadVersion.cpp",
    "chars": 1587,
    "preview": "// Source : https://leetcode.com/problems/first-bad-version/\n// Author : Hao Chen\n// Date   : 2015-10-19\n\n/*************"
  },
  {
    "path": "algorithms/cpp/firstMissingPositive/firstMissingPositive.cpp",
    "chars": 4068,
    "preview": "// Source : https://oj.leetcode.com/problems/first-missing-positive/\n// Author : Hao Chen\n// Date   : 2014-07-18\n\n/*****"
  },
  {
    "path": "algorithms/cpp/firstUniqueCharacterInAString/FirstUniqueCharacterInAString.cpp",
    "chars": 1795,
    "preview": "// Source : https://leetcode.com/problems/first-unique-character-in-a-string/\n// Author : Hao Chen\n// Date   : 2016-08-2"
  },
  {
    "path": "algorithms/cpp/fizzBuzz/FizzBuzz.cpp",
    "chars": 2268,
    "preview": "// Source : https://leetcode.com/problems/fizz-buzz/\n// Author : Hao Chen\n// Date   : 2016-11-13\n\n/*********************"
  },
  {
    "path": "algorithms/cpp/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp",
    "chars": 1688,
    "preview": "// Source : https://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/\n// Author : Hao Chen\n// Date   : 2014-0"
  },
  {
    "path": "algorithms/cpp/flattenNestedListIterator/FlattenNestedListIterator.cpp",
    "chars": 2317,
    "preview": "// Source : https://leetcode.com/problems/flatten-nested-list-iterator/\n// Author : Hao Chen\n// Date   : 2016-05-30\n\n/**"
  },
  {
    "path": "algorithms/cpp/formArrayByConcatenatingSubarraysOfAnotherArray/FormArrayByConcatenatingSubarraysOfAnotherArray.cpp",
    "chars": 3862,
    "preview": "// Source : https://leetcode.com/problems/form-array-by-concatenating-subarrays-of-another-array/\n// Author : Hao Chen\n/"
  },
  {
    "path": "algorithms/cpp/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp",
    "chars": 3267,
    "preview": "// Source : https://oj.leetcode.com/problems/fraction-to-recurring-decimal/\n// Author : Hao Chen\n// Date   : 2014-12-16\n"
  },
  {
    "path": "algorithms/cpp/frequencyOfTheMostFrequentElement/FrequencyOfTheMostFrequentElement.cpp",
    "chars": 2000,
    "preview": "// Source : https://leetcode.com/problems/frequency-of-the-most-frequent-element/\n// Author : Hao Chen\n// Date   : 2021-"
  },
  {
    "path": "algorithms/cpp/friendCircles/FriendCircles.cpp",
    "chars": 3783,
    "preview": "// Source : https://leetcode.com/problems/friend-circles/\n// Author : Hao Chen\n// Date   : 2019-03-26\n\n/****************"
  },
  {
    "path": "algorithms/cpp/frogJump/FrogJump.cpp",
    "chars": 4835,
    "preview": "// Source : https://leetcode.com/problems/frog-jump/\n// Author : Hao Chen\n// Date   : 2016-11-12\n\n/*********************"
  },
  {
    "path": "algorithms/cpp/gameOfLife/GameOfLife.cpp",
    "chars": 3326,
    "preview": "// Source : https://leetcode.com/problems/game-of-life/\n// Author : Hao Chen\n// Date   : 2019-03-20\n\n/******************"
  },
  {
    "path": "algorithms/cpp/gasStation/gasStation.cpp",
    "chars": 1446,
    "preview": "// Source : https://oj.leetcode.com/problems/gas-station/\n// Author : Hao Chen\n// Date   : 2014-10-11\n\n/****************"
  },
  {
    "path": "algorithms/cpp/generateParentheses/generateParentheses.cpp",
    "chars": 1436,
    "preview": "// Source : https://oj.leetcode.com/problems/generate-parentheses/\n// Author : Hao Chen\n// Date   : 2014-06-29\n\n/*******"
  },
  {
    "path": "algorithms/cpp/grayCode/grayCode.cpp",
    "chars": 3445,
    "preview": "// Source : https://oj.leetcode.com/problems/gray-code/\n// Author : Hao Chen\n// Date   : 2014-06-20\n\n/******************"
  },
  {
    "path": "algorithms/cpp/greatestCommonDivisorOfStrings/GreatestCommonDivisorOfStrings.cpp",
    "chars": 2156,
    "preview": "// Source : https://leetcode.com/problems/greatest-common-divisor-of-strings/\n// Author : Hao Chen\n// Date   : 2020-07-1"
  },
  {
    "path": "algorithms/cpp/h-Index/h-Index.II.cpp",
    "chars": 935,
    "preview": "// Source : https://leetcode.com/problems/h-index-ii/\n// Author : Hao Chen\n// Date   : 2015-11-08\n\n/********************"
  },
  {
    "path": "algorithms/cpp/h-Index/h-Index.cpp",
    "chars": 2482,
    "preview": "// Source : https://leetcode.com/problems/h_index/\n// Author : Calinescu Valentin, Hao Chen\n// Date   : 2015-10-22\n\n/***"
  },
  {
    "path": "algorithms/cpp/happyNumber/HappyNumber.cpp",
    "chars": 1661,
    "preview": "// Source : https://leetcode.com/problems/happy-number/\n// Author : Hao Chen\n// Date   : 2015-06-08\n\n/******************"
  },
  {
    "path": "algorithms/cpp/houseRobber/houseRobber.II.cpp",
    "chars": 1963,
    "preview": "// Source : https://leetcode.com/problems/house-robber-ii/\n// Author : Hao Chen\n// Date   : 2015-06-10\n\n/***************"
  },
  {
    "path": "algorithms/cpp/houseRobber/houseRobber.cpp",
    "chars": 2641,
    "preview": "// Source : https://leetcode.com/problems/house-robber/\n// Author : Hao Chen\n// Date   : 2015-04-07\n\n/******************"
  },
  {
    "path": "algorithms/cpp/houseRobber/houseRobberIII.cpp",
    "chars": 4918,
    "preview": "// Source : https://leetcode.com/problems/house-robber-iii/\n// Author : Calinescu Valentin, Hao Chen\n// Date   : 2016-04"
  },
  {
    "path": "algorithms/cpp/implementQueueUsingStacks/ImplementQueueUsingStacks.cpp",
    "chars": 1787,
    "preview": "// Source : https://leetcode.com/problems/implement-queue-using-stacks/\n// Author : Hao Chen\n// Date   : 2015-07-16\n\n/**"
  },
  {
    "path": "algorithms/cpp/implementStackUsingQueues/ImplementStackUsingQueues.cpp",
    "chars": 2045,
    "preview": "// Source : https://leetcode.com/problems/implement-stack-using-queues/\n// Author : Hao Chen\n// Date   : 2015-06-13\n\n/**"
  },
  {
    "path": "algorithms/cpp/implementTriePrefixTree/ImplementTriePrefixTree.cpp",
    "chars": 1951,
    "preview": "// Source : https://leetcode.com/problems/implement-trie-prefix-tree/\n// Author : Hao Chen\n// Date   : 2015-06-09\n\n/****"
  },
  {
    "path": "algorithms/cpp/increasingTripletSubsequence/increasingTripletSubsequence.cpp",
    "chars": 1977,
    "preview": "// Source : https://leetcode.com/problems/increasing-triplet-subsequence/\n// Author : Calinescu Valentin, Hao Chen\n// Da"
  },
  {
    "path": "algorithms/cpp/incrementalMemoryLeak/IncrementalMemoryLeak.cpp",
    "chars": 2801,
    "preview": "// Source : https://leetcode.com/problems/incremental-memory-leak/\n// Author : Hao Chen\n// Date   : 2021-05-22\n\n/*******"
  },
  {
    "path": "algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1.cpp",
    "chars": 2896,
    "preview": "// Source : https://leetcode.com/problems/insert-delete-getrandom-o1/\n// Author : Hao Chen\n// Date   : 2016-08-25\n\n/****"
  },
  {
    "path": "algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1DuplicatesAllowed.cpp",
    "chars": 3387,
    "preview": "// Source : https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/\n// Author : Hao Chen\n// Date   "
  },
  {
    "path": "algorithms/cpp/insertInterval/insertInterval.cpp",
    "chars": 2602,
    "preview": "// Source : https://oj.leetcode.com/problems/insert-interval/\n// Author : Hao Chen\n// Date   : 2014-08-26\n\n/************"
  },
  {
    "path": "algorithms/cpp/insertionSortList/insertionSortList.cpp",
    "chars": 1954,
    "preview": "// Source : https://oj.leetcode.com/problems/insertion-sort-list/\n// Author : Hao Chen\n// Date   : 2014-07-19\n\n/********"
  },
  {
    "path": "algorithms/cpp/integerBreak/IntegerBreak.cpp",
    "chars": 1758,
    "preview": "// Source : https://leetcode.com/problems/integer-break/\n// Author : Hao Chen\n// Date   : 2016-05-29\n\n/*****************"
  },
  {
    "path": "algorithms/cpp/integerReplacement/IntegerReplacement.cpp",
    "chars": 2236,
    "preview": "// Source : https://leetcode.com/problems/integer-replacement/\n// Author : Hao Chen\n// Date   : 2016-11-04\n\n/***********"
  },
  {
    "path": "algorithms/cpp/integerToEnglishWords/IntegerToEnglishWords.cpp",
    "chars": 3510,
    "preview": "// Source : https://leetcode.com/problems/integer-to-english-words/\n// Author : Hao Chen\n// Date   : 2015-10-22\n\n/******"
  },
  {
    "path": "algorithms/cpp/integerToRoman/integerToRoman.cpp",
    "chars": 1080,
    "preview": "// Source : https://oj.leetcode.com/problems/integer-to-roman/\n// Author : Hao Chen\n// Date   : 2014-07-17\n\n/***********"
  },
  {
    "path": "algorithms/cpp/interleavingString/interleavingString.cpp",
    "chars": 3888,
    "preview": "// Source : https://oj.leetcode.com/problems/interleaving-string/\n// Author : Hao Chen\n// Date   : 2014-08-27\n\n/********"
  },
  {
    "path": "algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArrays.cpp",
    "chars": 2233,
    "preview": "// Source : https://leetcode.com/problems/intersection-of-two-arrays/\n// Author : Calinescu Valentin, Hao Chen\n// Date  "
  },
  {
    "path": "algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArraysII.cpp",
    "chars": 2955,
    "preview": "// Source : https://leetcode.com/problems/intersection-of-two-arrays-ii/\n// Author : Calinescu Valentin, Hao Chen\n// Dat"
  },
  {
    "path": "algorithms/cpp/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp",
    "chars": 2220,
    "preview": "// Source : https://oj.leetcode.com/problems/intersection-of-two-linked-lists/\n// Author : Hao Chen\n// Date   : 2014-12-"
  },
  {
    "path": "algorithms/cpp/intervalListIntersectons/IntervalListIntersections.cpp",
    "chars": 3422,
    "preview": "// Source : https://leetcode.com/problems/interval-list-intersections/\n// Author : Hao Chen\n// Date   : 2019-02-05\n\n/***"
  },
  {
    "path": "algorithms/cpp/invertBinaryTree/InvertBinaryTree.cpp",
    "chars": 1885,
    "preview": "// Source : https://leetcode.com/problems/invert-binary-tree/\n// Author : Hao Chen\n// Date   : 2015-06-12\n\n/************"
  },
  {
    "path": "algorithms/cpp/isSubsequence/IsSubsequence.cpp",
    "chars": 1546,
    "preview": "// Source : https://leetcode.com/problems/is-subsequence/\n// Author : Hao Chen\n// Date   : 2016-09-08\n\n/****************"
  },
  {
    "path": "algorithms/cpp/islandPerimeter/IslandPerimeter.cpp",
    "chars": 1929,
    "preview": "// Source : https://leetcode.com/problems/island-perimeter/\n// Author : Hao Chen\n// Date   : 2019-02-04\n\n/**************"
  },
  {
    "path": "algorithms/cpp/isomorphicStrings/IsomorphicStrings.cpp",
    "chars": 1554,
    "preview": "// Source : https://leetcode.com/problems/isomorphic-strings/\n// Author : Hao Chen\n// Date   : 2015-06-09\n\n/************"
  },
  {
    "path": "algorithms/cpp/jewelsAndStones/JewelsAndStones.cpp",
    "chars": 1280,
    "preview": "// Source : https://leetcode.com/problems/jewels-and-stones/description\n// Author : Hao Chen\n// Date   : 2018-06-23\n\n/**"
  },
  {
    "path": "algorithms/cpp/jumpGame/jumpGame.II.cpp",
    "chars": 2129,
    "preview": "// Source : https://oj.leetcode.com/problems/jump-game-ii/\n// Author : Hao Chen\n// Date   : 2014-07-18\n\n/***************"
  },
  {
    "path": "algorithms/cpp/jumpGame/jumpGame.VII.cpp",
    "chars": 1154,
    "preview": "// Source : https://leetcode.com/problems/jump-game-vii/\n// Author : Hao Chen\n// Date   : 2021-05-30\n\n/*****************"
  },
  {
    "path": "algorithms/cpp/jumpGame/jumpGame.cpp",
    "chars": 1181,
    "preview": "// Source : https://oj.leetcode.com/problems/jump-game/\n// Author : Hao Chen\n// Date   : 2014-06-27\n\n/******************"
  },
  {
    "path": "algorithms/cpp/kthLargestElementInAnArray/KthLargestElementInAnArray.cpp",
    "chars": 1919,
    "preview": "// Source : https://leetcode.com/problems/kth-largest-element-in-an-array/\n// Author : Hao Chen\n// Date   : 2015-06-11\n\n"
  },
  {
    "path": "algorithms/cpp/kthSmallestElementInaBST/KthSmallestElementInABst.cpp",
    "chars": 2216,
    "preview": "// Source : https://leetcode.com/problems/kth-smallest-element-in-a-bst/\n// Author : Hao Chen\n// Date   : 2015-07-03\n\n/*"
  },
  {
    "path": "algorithms/cpp/largestColorValueInADirectedGraph/LargestColorValueInADirectedGraph.cpp",
    "chars": 5559,
    "preview": "// Source : https://leetcode.com/problems/largest-color-value-in-a-directed-graph/\n// Author : Hao Chen\n// Date   : 2021"
  },
  {
    "path": "algorithms/cpp/largestMergeOfTwoStrings/LargestMergeOfTwoStrings.cpp",
    "chars": 3128,
    "preview": "// Source : https://leetcode.com/problems/largest-merge-of-two-strings/\n// Author : Hao Chen\n// Date   : 2021-02-11\n\n/**"
  },
  {
    "path": "algorithms/cpp/largestNumber/largestNumber.cpp",
    "chars": 1392,
    "preview": "// Source : https://oj.leetcode.com/problems/largest-number/\n// Author : Hao Chen\n// Date   : 2015-01-16\n\n/*************"
  }
]

// ... and 530 more files (download for full content)

About this extraction

This page contains the full source code of the haoel/leetcode GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 730 files (1.6 MB), approximately 491.6k tokens, and a symbol index with 2441 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!