leetcode | LeetCode Problems ' Solutions | Learning library

 by   haoel C++ Version: Current License: No License

kandi X-RAY | leetcode Summary

kandi X-RAY | leetcode Summary

leetcode is a C++ library typically used in Tutorial, Learning, Example Codes, LeetCode applications. leetcode has no bugs, it has no vulnerabilities and it has medium support. You can download it from GitHub.

(Notes: "" means you need to buy a book from Leetcode). | # | Title | Solution | Difficulty | |---| ----- | -------- | ---------- | |1882|[Process Tasks Using Servers] | [C] ./algorithms/cpp/processTasksUsingServers/ProcessTasksUsingServers.cpp)|Medium| |1881|[Maximum Value after Insertion] | [C] ./algorithms/cpp/maximumValueAfterInsertion/MaximumValueAfterInsertion.cpp)|Medium| |1880|[Check if Word Equals Summation of Two Words] | [C] ./algorithms/cpp/checkIfWordEqualsSummationOfTwoWords/CheckIfWordEqualsSummationOfTwoWords.cpp)|Easy| |1871|[Jump Game VII] | [C] ./algorithms/cpp/jumpGame/jumpGame.VII.cpp)|Medium| |1870|[Minimum Speed to Arrive on Time] | [C] ./algorithms/cpp/minimumSpeedToArriveOnTime/MinimumSpeedToArriveOnTime.cpp)|Medium| |1869|[Longer Contiguous Segments of Ones than Zeros] | [C] ./algorithms/cpp/longerContiguousSegmentsOfOnesThanZeros/LongerContiguousSegmentsOfOnesThanZeros.cpp)|Easy| |1862|[Sum of Floored Pairs] | [C] ./algorithms/cpp/sumOfFlooredPairs/SumOfFlooredPairs.cpp)|Hard| |1861|[Rotating the Box] | [C] ./algorithms/cpp/rotatingTheBox/RotatingTheBox.cpp)|Medium| |1860|[Incremental Memory Leak] | [C] ./algorithms/cpp/incrementalMemoryLeak/IncrementalMemoryLeak.cpp)|Medium| |1859|[Sorting the Sentence] | [C] ./algorithms/cpp/sortingTheSentence/SortingTheSentence.cpp)|Easy| |1857|[Largest Color Value in a Directed Graph] | [C] ./algorithms/cpp/largestColorValueInADirectedGraph/LargestColorValueInADirectedGraph.cpp)|Hard| |1856|[Maximum Subarray Min-Product] | [C] ./algorithms/cpp/maximumSubarrayMinProduct/MaximumSubarrayMinProduct.cpp)|Medium| |1855|[Maximum Distance Between a Pair of Values] | [C] ./algorithms/cpp/maximumDistanceBetweenAPairOfValues/MaximumDistanceBetweenAPairOfValues.cpp)|Medium| |1854|[Maximum Population Year] | [C] ./algorithms/cpp/maximumPopulationYear/MaximumPopulationYear.cpp)|Easy| |1851|[Minimum Interval to Include Each Query] | [C] ./algorithms/cpp/minimumIntervalToIncludeEachQuery/MinimumIntervalToIncludeEachQuery.cpp)|Hard| |1850|[Minimum Adjacent Swaps to Reach the Kth Smallest Number] | [C] ./algorithms/cpp/minimumAdjacentSwapsToReachTheKthSmallestNumber/MinimumAdjacentSwapsToReachTheKthSmallestNumber.cpp)|Medium| |1849|[Splitting a String Into Descending Consecutive Values] | [C] ./algorithms/cpp/splittingAStringIntoDescendingConsecutiveValues/SplittingAStringIntoDescendingConsecutiveValues.cpp)|Medium| |1848|[Minimum Distance to the Target Element] | [C] ./algorithms/cpp/minimumDistanceToTheTargetElement/MinimumDistanceToTheTargetElement.cpp)|Easy| |1847|[Closest Room] | [C] ./algorithms/cpp/closestRoom/ClosestRoom.cpp)|Hard| |1846|[Maximum Element After Decreasing and Rearranging] | [C] ./algorithms/cpp/maximumElementAfterDecreasingAndRearranging/MaximumElementAfterDecreasingAndRearranging.cpp)|Medium| |1845|[Seat Reservation Manager] | [C] ./algorithms/cpp/seatReservationManager/SeatReservationManager.cpp)|Medium| |1844|[Replace All Digits with Characters] | [C] ./algorithms/cpp/replaceAllDigitsWithCharacters/ReplaceAllDigitsWithCharacters.cpp)|Easy| |1840|[Maximum Building Height] | [C] ./algorithms/cpp/maximumBuildingHeight/MaximumBuildingHeight.cpp)|Hard| |1839|[Longest Substring Of All Vowels in Order] | [C] ./algorithms/cpp/longestSubstringOfAllVowelsInOrder/LongestSubstringOfAllVowelsInOrder.cpp)|Medium| |1838|[Frequency of the Most Frequent Element] | [C] ./algorithms/cpp/frequencyOfTheMostFrequentElement/FrequencyOfTheMostFrequentElement.cpp)|Medium| |1837|[Sum of Digits in Base K] | [C] ./algorithms/cpp/sumOfDigitsInBaseK/SumOfDigitsInBaseK.cpp)|Easy| |1835|[Find XOR Sum of All Pairs Bitwise AND] | [C] ./algorithms/cpp/findXorSumOfAllPairsBitwiseAnd/FindXorSumOfAllPairsBitwiseAnd.cpp)|Hard| |1834|[Single-Threaded CPU] | [C] ./algorithms/cpp/singleThreadedCpu/SingleThreadedCpu.cpp)|Medium| |1833|[Maximum Ice Cream Bars] | [C] ./algorithms/cpp/maximumIceCreamBars/MaximumIceCreamBars.cpp)|Medium| |1832|[Check if the Sentence Is Pangram] | [C] ./algorithms/cpp/checkIfTheSentenceIsPangram/CheckIfTheSentenceIsPangram.cpp)|Easy| |1829|[Maximum XOR for Each Query] | [C] ./algorithms/cpp/maximumXorForEachQuery/MaximumXorForEachQuery.cpp)|Medium| |1828|[Queries on Number of Points Inside a Circle] | [C] ./algorithms/cpp/queriesOnNumberOfPointsInsideACircle/QueriesOnNumberOfPointsInsideACircle.cpp)|Medium| |1827|[Minimum Operations to Make the Array Increasing] | [C] ./algorithms/cpp/minimumOperationsToMakeTheArrayIncreasing/MinimumOperationsToMakeTheArrayIncreasing.cpp)|Easy| |1825|[Finding MK Average] | [C] ./algorithms/cpp/findingMkAverage/FindingMkAverage.cpp)|Hard| |1824|[Minimum Sideway Jumps] | [C] ./algorithms/cpp/minimumSidewayJumps/MinimumSidewayJumps.cpp)|Medium| |1823|[Find the Winner of the Circular Game] | [C] ./algorithms/cpp/findTheWinnerOfTheCircularGame/FindTheWinnerOfTheCircularGame.cpp)|Medium| |1822|[Sign of the Product of an Array] | [C] ./algorithms/cpp/signOfTheProductOfAnArray/SignOfTheProductOfAnArray.cpp)|Easy| |1819|[Number of Different Subsequences GCDs] | [C] ./algorithms/cpp/numberOfDifferentSubsequencesGcds/NumberOfDifferentSubsequencesGcds.cpp)|Hard| |1818|[Minimum Absolute Sum Difference] | [C] ./algorithms/cpp/minimumAbsoluteSumDifference/MinimumAbsoluteSumDifference.cpp)|Medium| |1817|[Finding the Users Active Minutes] | [C] ./algorithms/cpp/findingTheUsersActiveMinutes/FindingTheUsersActiveMinutes.cpp)|Medium| |1816|[Truncate Sentence] | [C] ./algorithms/cpp/truncateSentence/TruncateSentence.cpp)|Easy| |1815|[Maximum Number of Groups Getting Fresh Donuts] | [C] ./algorithms/cpp/maximumNumberOfGroupsGettingFreshDonuts/MaximumNumberOfGroupsGettingFreshDonuts.cpp)|Hard| |1814|[Count Nice Pairs in an Array] | [C] ./algorithms/cpp/countNicePairsInAnArray/CountNicePairsInAnArray.cpp)|Medium| |1813|[Sentence Similarity III] | [C] ./algorithms/cpp/sentenceSimilarity/SentenceSimilarity.III.cpp)|Medium| |1812|[Determine Color of a Chessboard Square] | [C] ./algorithms/cpp/determineColorOfAChessboardSquare/DetermineColorOfAChessboardSquare.cpp)|Easy| |1808|[Maximize Number of Nice Divisors] | [C] ./algorithms/cpp/maximizeNumberOfNiceDivisors/MaximizeNumberOfNiceDivisors.cpp)|Hard| |1807|[Evaluate the Bracket Pairs of a String] | [C] ./algorithms/cpp/evaluateTheBracketPairsOfAString/EvaluateTheBracketPairsOfAString.cpp)|Medium| |1806|[Minimum Number of Operations to Reinitialize a Permutation] | [C] ./algorithms/cpp/minimumNumberOfOperationsToReinitializeAPermutation/MinimumNumberOfOperationsToReinitializeAPermutation.cpp)|Medium| |1805|[Number of Different Integers in a String] | [C] ./algorithms/cpp/numberOfDifferentIntegersInAString/NumberOfDifferentIntegersInAString.cpp)|Easy| |1803|[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] | [C] ./algorithms/cpp/maximumValueAtAGivenIndexInABoundedArray/MaximumValueAtAGivenIndexInABoundedArray.cpp)|Medium| |1801|[Number of Orders in the Backlog] | [C] ./algorithms/cpp/numberOfOrdersInTheBacklog/NumberOfOrdersInTheBacklog.cpp)|Medium| |1800|[Maximum Ascending Subarray Sum] | [C] ./algorithms/cpp/maximumAscendingSubarraySum/MaximumAscendingSubarraySum.cpp)|Easy| |1799|[Maximize Score After N Operations] | [C] ./algorithms/cpp/maximizeScoreAfterNOperations/MaximizeScoreAfterNOperations.cpp)|Hard| |1798|[Maximum Number of Consecutive Values You Can Make] | [C] ./algorithms/cpp/maximumNumberOfConsecutiveValuesYouCanMake/MaximumNumberOfConsecutiveValuesYouCanMake.cpp)|Medium| |1797|[Design Authentication Manager] | [C] ./algorithms/cpp/designAuthenticationManager/DesignAuthenticationManager.cpp)|Medium| |1796|[Second Largest Digit in a String] | [C] ./algorithms/cpp/secondLargestDigitInAString/SecondLargestDigitInAString.cpp)|Easy| |1793|[Maximum Score of a Good Subarray] | [C] ./algorithms/cpp/maximumScoreOfAGoodSubarray/MaximumScoreOfAGoodSubarray.cpp)|Hard| |1792|[Maximum Average Pass Ratio] | [C] ./algorithms/cpp/maximumAveragePassRatio/MaximumAveragePassRatio.cpp)|Medium| |1791|[Find Center of Star Graph] | [C] ./algorithms/cpp/findCenterOfStarGraph/FindCenterOfStarGraph.cpp)|Medium| |1790|[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] | [C] ./algorithms/cpp/makeTheXorOfAllSegmentsEqualToZero/MakeTheXorOfAllSegmentsEqualToZero.cpp)|Hard| |1786|[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] | [C] ./algorithms/cpp/minimumElementsToAddToFormAGivenSum/MinimumElementsToAddToFormAGivenSum.cpp)|Medium| |1784|[Check if Binary String Has at Most One Segment of Ones] | [C] ./algorithms/cpp/checkIfBinaryStringHasAtMostOneSegmentOfOnes/CheckIfBinaryStringHasAtMostOneSegmentOfOnes.cpp)|Easy| |1782|[Count Pairs Of Nodes] | [C] ./algorithms/cpp/countPairsOfNodes/CountPairsOfNodes.cpp)|Hard| |1781|[Sum of Beauty of All Substrings] | [C] ./algorithms/cpp/sumOfBeautyOfAllSubstrings/SumOfBeautyOfAllSubstrings.cpp)|Medium| |1780|[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] | [C] ./algorithms/cpp/findNearestPointThatHasTheSameXOrYCoordinate/FindNearestPointThatHasTheSameXOrYCoordinate.cpp)|Easy| |1775|[Equal Sum Arrays With Minimum Number of Operations] | [C] ./algorithms/cpp/equalSumArraysWithMinimumNumberOfOperations/EqualSumArraysWithMinimumNumberOfOperations.cpp)|Medium| |1774|[Closest Dessert Cost] | [C] ./algorithms/cpp/closestDessertCost/ClosestDessertCost.cpp)|Medium| |1773|[Count Items Matching a Rule] | [C] ./algorithms/cpp/countItemsMatchingARule/CountItemsMatchingARule.cpp)|Easy| |1771|[Maximize Palindrome Length From Subsequences] | [C] ./algorithms/cpp/maximizePalindromeLengthFromSubsequences/MaximizePalindromeLengthFromSubsequences.cpp)|Hard| |1770|[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] | [C] ./algorithms/cpp/minimumNumberOfOperationsToMoveAllBallsToEachBox/MinimumNumberOfOperationsToMoveAllBallsToEachBox.cpp)|Medium| |1768|[Merge Strings Alternately] | [C] ./algorithms/cpp/mergeStringsAlternately/MergeStringsAlternately.cpp)|Easy| |1766|[Tree of Coprimes] | [C] ./algorithms/cpp/treeOfCoprimes/TreeOfCoprimes.cpp)|Hard| |1765|[Map of Highest Peak] | [C] ./algorithms/cpp/mapOfHighestPeak/MapOfHighestPeak.cpp)|Medium| |1764|[Form Array by Concatenating Subarrays of Another Array] | [C] ./algorithms/cpp/formArrayByConcatenatingSubarraysOfAnotherArray/FormArrayByConcatenatingSubarraysOfAnotherArray.cpp)|Medium| |1763|[Longest Nice Substring] | [C] ./algorithms/cpp/longestNiceSubstring/LongestNiceSubstring.cpp)|Easy| |1761|[Minimum Degree of a Connected Trio in a Graph] | [C] ./algorithms/cpp/minimumDegreeOfAConnectedTrioInAGraph/MinimumDegreeOfAConnectedTrioInAGraph.cpp)|Hard| |1760|[Minimum Limit of Balls in a Bag] | [C] ./algorithms/cpp/minimumLimitOfBallsInABag/MinimumLimitOfBallsInABag.cpp)|Medium| |1759|[Count Number of Homogenous Substrings] | [C] ./algorithms/cpp/countNumberOfHomogenousSubstrings/CountNumberOfHomogenousSubstrings.cpp)|Medium| |1758|[Minimum Changes To Make Alternating Binary String] | [C] ./algorithms/cpp/minimumChangesToMakeAlternatingBinaryString/MinimumChangesToMakeAlternatingBinaryString.cpp)|Easy| |1755|[Closest Subsequence Sum] | [C] ./algorithms/cpp/closestSubsequenceSum/ClosestSubsequenceSum.cpp)|Hard| |1754|[Largest Merge Of Two Strings] | [C] ./algorithms/cpp/largestMergeOfTwoStrings/LargestMergeOfTwoStrings.cpp)|Medium| |1753|[Maximum Score From Removing Stones] | [C] ./algorithms/cpp/maximumScoreFromRemovingStones/MaximumScoreFromRemovingStones.cpp)|Medium| |1752|[Check if Array Is Sorted and Rotated] | [C] ./algorithms/cpp/checkIfArrayIsSortedAndRotated/CheckIfArrayIsSortedAndRotated.cpp)|Easy| |1751|[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] | [C] ./algorithms/cpp/minimumLengthOfStringAfterDeletingSimilarEnds/MinimumLengthOfStringAfterDeletingSimilarEnds.cpp)|Medium| |1749|[Maximum Absolute Sum of Any Subarray] | [C] ./algorithms/cpp/maximumAbsoluteSumOfAnySubarray/MaximumAbsoluteSumOfAnySubarray.cpp)|Medium| |1748|[Sum of Unique Elements] | [C] ./algorithms/cpp/sumOfUniqueElements/SumOfUniqueElements.cpp)|Easy| |1743|[Restore the Array From Adjacent Pairs] | [C] ./algorithms/cpp/restoreTheArrayFromAdjacentPairs/RestoreTheArrayFromAdjacentPairs.cpp)|Medium| |1742|[Maximum Number of Balls in a Box] | [C] ./algorithms/cpp/maximumNumberOfBallsInABox/MaximumNumberOfBallsInABox.cpp)|Easy| |1739|[Building Boxes] | [C] ./algorithms/cpp/buildingBoxes/BuildingBoxes.cpp)|Hard| |1738|[Find Kth Largest XOR Coordinate Value] | [C] ./algorithms/cpp/findKthLargestXorCoordinateValue/FindKthLargestXorCoordinateValue.cpp)|Medium| |1736|[Latest Time by Replacing Hidden Digits] | [C] ./algorithms/cpp/latestTimeByReplacingHiddenDigits/LatestTimeByReplacingHiddenDigits.cpp)|Easy| |1734|[Decode XORed Permutation] | [C] ./algorithms/cpp/decodeXORedPermutation/DecodeXoredPermutation.cpp)|Medium| |1733|[Minimum Number of People to Teach] | [C] ./algorithms/cpp/minimumNumberOfPeopleToTeach/MinimumNumberOfPeopleToTeach.cpp)|Medium| |1732|[Find the Highest Altitude] | [C] ./algorithms/cpp/findTheHighestAltitude/FindTheHighestAltitude.cpp)|Easy| |1727|[Largest Submatrix With Rearrangements] | [C] ./algorithms/cpp/largestSubmatrixWithRearrangements/LargestSubmatrixWithRearrangements.cpp)|Medium| |1726|[Tuple with Same Product] | [C] ./algorithms/cpp/tupleWithSameProduct/TupleWithSameProduct.cpp)|Medium| |1725|[Number Of Rectangles That Can Form The Largest Square] | [C] ./algorithms/cpp/numberOfRectanglesThatCanFormTheLargestSquare/NumberOfRectanglesThatCanFormTheLargestSquare.cpp)|Easy| |1718|[Construct the Lexicographically Largest Valid Sequence] | [C] ./algorithms/cpp/constructTheLexicographicallyLargestValidSequence/ConstructTheLexicographicallyLargestValidSequence.cpp)|Medium| |1717|[Maximum Score From Removing Substrings] | [C] ./algorithms/cpp/maximumScoreFromRemovingSubstrings/MaximumScoreFromRemovingSubstrings.cpp)|Medium| |1716|[Calculate Money in Leetcode Bank] | [C] ./algorithms/cpp/calculateMoneyInLeetcodeBank/CalculateMoneyInLeetcodeBank.cpp)|Easy| |1712|[Ways to Split Array Into Three Subarrays] | [C] ./algorithms/cpp/waysToSplitArrayIntoThreeSubarrays/WaysToSplitArrayIntoThreeSubarrays.cpp)|Medium| |1711|[Count Good Meals] | [C] ./algorithms/cpp/countGoodMeals/CountGoodMeals.cpp)|Medium| |1710|[Maximum Units on a Truck] | [C] ./algorithms/cpp/maximumUnitsOnATruck/MaximumUnitsOnATruck.cpp)|Easy| |1700|[Number of Students Unable to Eat Lunch] | [C] ./algorithms/cpp/numberOfStudentsUnableToEatLunch/NumberOfStudentsUnableToEatLunch.cpp)|Easy| |1695|[Maximum Erasure Value] | [C] ./algorithms/cpp/maximumErasureValue/MaximumErasureValue.cpp)|Medium| |1694|[Reformat Phone Number] | [C] ./algorithms/cpp/reformatPhoneNumber/ReformatPhoneNumber.cpp)|Easy| |1625|[Lexicographically Smallest String After Applying Operations] | [C] ./algorithms/cpp/lexicographicallySmallestStringAfterApplyingOperations/LexicographicallySmallestStringAfterApplyingOperations.cpp)|Medium| |1624|[Largest Substring Between Two Equal Characters] | [C] ./algorithms/cpp/largestSubstringBetweenTwoEqualCharacters/LargestSubstringBetweenTwoEqualCharacters.cpp)|Easy| |1605|[Find Valid Matrix Given Row and Column Sums] | [C] ./algorithms/cpp/FindValidMatrixGivenRowAndColumnSums/FindValidMatrixGivenRowAndColumnSums.cpp)|Medium| |1573|[Number of Ways to Split a String] | [C] ./algorithms/cpp/NumberOfWaysToSplitString/NumberOfWaysToSplitString.cpp)|Medium| |1556|[Thousand Separator] | [C] ./algorithms/cpp/thousandSeparator/ThousandSeparator.cpp)|Easy| |1551|[Minimum Operations to Make Array Equal] | [C] ./algorithms/cpp/minimumOperationsToMakeArrayEqual/MinimumOperationsToMakeArrayEqual.cpp)|Medium| |1550|[Three Consecutive Odds] | [C] ./algorithms/cpp/threeConsecutiveOdds/ThreeConsecutiveOdds.cpp)|Easy| |1541|[Minimum Insertions to Balance a Parentheses String] | [C] ./algorithms/cpp/minimumInsertionsToBalanceAParenthesesString/MinimumInsertionsToBalanceAParenthesesString.cpp)|Medium| |1535|[Find the Winner of an Array Game] | [C] ./algorithms/cpp/findTheWinnerOfAnArrayGame/FindTheWinnerOfAnArrayGame.cpp)|Medium| |1529|[Bulb Switcher IV] | [C] ./algorithms/cpp/bulbSwitcher/BulbSwitcher.IV.cpp)|Medium| |1528|[Shuffle String] | [C] ./algorithms/cpp/shuffleString/ShuffleString.cpp)|Easy| |1525|[Number of Good Ways to Split a String] | [C] ./algorithms/cpp/numberOfGoodWaysToSplitAString/NumberOfGoodWaysToSplitAString.cpp)|Medium| |1524|[Number of Sub-arrays With Odd Sum] | [C] ./algorithms/cpp/numberOfSubArraysWithOddSum/NumberOfSubArraysWithOddSum.cpp)|Medium| |1523|[Count Odd Numbers in an Interval Range] | [C] ./algorithms/cpp/countOddNumbersInAnIntervalRange/CountOddNumbersInAnIntervalRange.cpp)|Easy| |1513|[Number of Substrings With Only 1s] | [C] ./algorithms/cpp/numberOfSubstringsWithOnly1s/NumberOfSubstringsWithOnly1s.cpp)|Medium| |1470|[Shuffle the Array] | [C] ./algorithms/cpp/shuffleTheArray/ShuffleTheArray.cpp)|Easy| |1464|[Maximum Product of Two Elements in an Array] | [C] ./algorithms/cpp/maximumProductOfTwoElementsInAnArray/MaximumProductOfTwoElementsInAnArray.cpp)|Easy| |1460|[Make Two Arrays Equal by Reversing Sub-arrays] | [C] ./algorithms/cpp/twoArraysEqualByReversingSubArrays/MakeTwoArraysEqualByReversingSubArrays.cpp)|Easy| |1376|[Time Needed to Inform All Employees] | [C] ./algorithms/cpp/timeNeededToInformAllEmployees/TimeNeededToInformAllEmployees.cpp)|Medium| |1375|[Bulb Switcher III] | [C] ./algorithms/cpp/bulbSwitcher/BulbSwitcher.III.cpp)|Medium| |1353|[Maximum Number of Events That Can Be Attended] | [C] ./algorithms/cpp/maximumNumberOfEventsThatCanBeAttended/MaximumNumberOfEventsThatCanBeAttended.cpp)|Medium| |1333|[Filter Restaurants by Vegan-Friendly, Price and Distance] | [C] ./algorithms/cpp/filterRestaurantsByVeganFriendlyPriceAndDistance/FilterRestaurantsByVeganFriendlyPriceAndDistance.cpp)|Medium| |1207|[Unique Number of Occurrences] | [C] ./algorithms/cpp/uniqueNumberOfOccurrences/Unique-Number-of-Occurrences.cpp)|Easy| |1170|[Compare Strings by Frequency of the Smallest Character] | [C] ./algorithms/cpp/compareStringsByFrequencyOfTheSmallestCharacter/CompareStringsByFrequencyOfTheSmallestCharacter.cpp)|Easy| |1071|[Greatest Common Divisor of Strings] | [C] ./algorithms/cpp/greatestCommonDivisorOfStrings/GreatestCommonDivisorOfStrings.cpp)|Easy| |1030|[Matrix Cells in Distance Order] | [C] ./algorithms/cpp/matrixCellsInDistanceOrder/MatrixCellsInDistanceOrder.cpp)|Easy| |1029|[Two City Scheduling] | [C] ./algorithms/cpp/twoCityScheduling/TwoCityScheduling.cpp)|Easy| |1028|[Recover a Tree From Preorder Traversal] | [C] ./algorithms/cpp/recoverATreeFromPreorderTraversal/recoverATreeFromPreorderTraversal.cpp)|Hard| |1024|[Video Stitching] | [C] ./algorithms/cpp/videoStitching/VideoStitching.cpp)|Medium| |993|[Cousins in Binary Tree] | [C] ./algorithms/cpp/cousinsInBinaryTree/CousinsInBinaryTree.cpp)|Easy| |991|[Broken Calculator] | [C] ./algorithms/cpp/brokenCalculator/BrokenCalculator.cpp)|Medium| |990|[Satisfiability of Equality Equations] | [C] ./algorithms/cpp/satisfiabilityOfEqualityEquations/SatisfiabilityOfEqualityEquations.cpp)|Medium| |989|[Add to Array-Form of Integer] | [C] ./algorithms/cpp/addToArrayFormOfInteger/AddToArrayFormOfInteger.cpp)|Easy| |988|[Smallest String Starting From Leaf] | [C] ./algorithms/cpp/smallestStringStartingFromLeaf/SmallestStringStartingFromLeaf.cpp)|Medium| |987|[Vertical Order Traversal of a Binary Tree] | [C] ./algorithms/cpp/verticalOrderTraversalOfABinaryTree/VerticalOrderTraversalOfABinaryTree.cpp)|Medium| |986|[Interval List Intersections] | [C] ./algorithms/cpp/intervalListIntersectons/IntervalListIntersections.cpp)|Medium| |985|[Sum of Even Numbers After Queries] | [C] ./algorithms/cpp/sumOfEvenNumbersAfterQueries/SumOfEvenNumbersAfterQueries.cpp)|Easy| |984|[String Without AAA or BBB] | [C] ./algorithms/cpp/stringWithoutAAAOrBBB/StringWithoutAAAOrBBB.cpp)|Easy| |983|[Minimum Cost For Tickets] | [C] ./algorithms/cpp/minimumCostForTickets/MinimumCostForTickets.cpp)|Medium| |982|[Triples with Bitwise AND Equal To Zero] | [C] ./algorithms/cpp/triplesWithBitwiseANDEqualToZero/TriplesWithBitwiseAndEqualToZero.cpp)|Hard| |981|[Time Based Key-Value Store] | [C] ./algorithms/cpp/timeBasedKeyValueStore/TimeBasedKeyValueStore.cpp)|Medium| |980|[Unique Paths III] | [C] ./algorithms/cpp/uniquePaths/UniquePaths.III.cpp),[Python] ./algorithms/python/uniquePaths/uniquePathsIII.py)|Hard| |979|[Distribute Coins in Binary Tree] | [C] ./algorithms/cpp/distributeCoinsInBinaryTree/DistributeCoinsInBinaryTree.cpp)|Medium| |978|[Longest Turbulent Subarray] | [C] ./algorithms/cpp/longestTurbulentSubarray/LongestTurbulentSubarray.cpp),[Python] ./algorithms/python/LongestTurbulentSubarray/maxTurbulenceSize.py)|Medium| |977|[Squares of a Sorted Array] | [C] ./algorithms/cpp/squaresOfASortedArray/SquaresOfASortedArray.cpp), [Python] ./algorithms/python/SquaresOfSortedArray/sortedSquares.py)|Easy| |976|[Largest Perimeter Triangle] | [C] ./algorithms/cpp/largestPerimeterTriangle/largestPerimeterTriangle.cpp), [Python] ./algorithms/python/LargestPerimeterTriangle/largestPerimeter.py)|Easy| |971|[Flip Binary Tree To Match Preorder Traversal] | [Python] ./algorithms/python/FlipBinaryTreeToMatchPreorderTraversal/flipMatchVoyage.py)|Medium| |969|[Pancake Sorting] | [Python] ./algorithms/python/PancakeSorting/pancakeSort.py)|Medium| |961|[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] | [Python] ./algorithms/python/CheckCompletenessOfABinaryTree/isCompleteTree.py)|Medium| |951|[Flip Equivalent Binary Trees] | [Python] ./algorithms/python/FlipEquivalentBinaryTrees/flipEquiv.py)|Medium| |950|[Reveal Cards In Increasing Order] | [Python] ./algorithms/python/RevealCardsInIncreasingOrder/deckRevealedIncreasing.py)|Medium| |941|[Valid Mountain Array] | [Python] ./algorithms/python/ValidMountainArray/validMountainArray.py)|Easy| |933|[Number of Recent Calls] | [C] ./algorithms/cpp/numberOfRecentCalls/NumberOfRecentCalls.cpp)|Easy| |931|[Minimum Falling Path Sum] | [C] ./algorithms/cpp/minimumFallingPathSum/MinimumFallingPathSum.cpp)|Medium| |929|[Unique Email Addresses] | [C] ./algorithms/cpp/uniqueEmailAddresses/UniqueEmailAddresses.cpp)|Easy| |922|[Sort Array By Parity II] | [C] ./algorithms/cpp/sortArrayByParity/SortArrayByParity.II.cpp)|Easy| |914|[X of a Kind in a Deck of Cards] | [Python] ./algorithms/python/XOfAKindInADeckOfCards/hasGroupsSizeX.py)|Easy| |905|[Sort Array By Parity] | [C] ./algorithms/cpp/sortArrayByParity/SortArrayByParity.cpp)|Easy| |876|[Middle of the Linked List] | [Python] ./algorithms/python/MiddleOfTheLinkedList/middleOfTheLinkedList.py)|Easy| |859|[Buddy Strings] | [C] ./algorithms/cpp/buddyStrings/BuddyStrings.cpp)|Easy| |858|[Mirror Reflection] | [C] ./algorithms/cpp/mirrorReflection/MirrorReflection.cpp)|Medium| |852|[Peak Index in a Mountain Array] | [C] ./algorithms/cpp/peakIndexInAMountainArray/PeakIndexInAMountainArray.cpp)|Easy| |849|[Maximize Distance to Closest Person] | [Python] ./algorithms/python/MaximizeDistanceToClosestPerson/maxDistToClosest.py)|Easy| |844|[Backspace String Compare] | [C] ./algorithms/cpp/backspaceStringCompare/BackspaceStringCompare.cpp)|Easy| |837|[Most Common Word] | [C] ./algorithms/cpp/mostCommonWord/MostCommonWord.cpp)|Easy| |830|[Positions of Large Groups] | [Python] ./algorithms/python/PositionsOfLargeGroups/largeGroupPositions.py)|Easy| |820|[Short Encoding of Words] | [C] ./algorithms/cpp/shortEncodingOfWords/ShortEncodingOfWords.cpp)|Medium| |804|[Unique Morse Code Words] | [C] ./algorithms/cpp/uniqueMorseCodeWords/UniqueMorseCodeWords.cpp)|Easy| |771|[Jewels and Stones] | [C] ./algorithms/cpp/jewelsAndStones/JewelsAndStones.cpp)|Easy| |747|[Largest Number At Least Twice of Others] | [Python] ./algorithms/python/LargestNumberAtLeastTwiceOfOthers/dominantIndex.py)|Easy| |746|[Min Cost Climbing Stairs] | [C] ./algorithms/cpp/minCostClimbingStairs/MinCostClimbingStairs.cpp), [Python] ./algorithms/python/MinCostClimbingStairs/minCostClimbingStairs.py)|Easy| |721|[Accounts Merge] | [C] ./algorithms/cpp/accountsMerge/AccountsMerge.cpp)|Medium| |717|[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] | [C] ./algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithTransactionFee.cpp)|Medium| |712|[Minimum ASCII Delete Sum for Two Strings] | [C] ./algorithms/cpp/minimumASCIIDeleteSumForTwoStrings/MinimumAsciiDeleteSumForTwoStrings.cpp)|Medium| |695|[Max Area of Island] | [C] ./algorithms/cpp/maxAreaOfIsland/MaxAreaOfIsland.cpp)|Medium| |687|[Longest Univalue Path] | [Python] ./algorithms/python/LongestUnivaluePath/longestUnivaluePath.py)|Easy| |684|[Redundant Connection] | [Python] ./algorithms/python/RedundantConnection/findRedundantConnection.py)|Medium| |674|[Longest Continuous Increasing Subsequence] | [Python] ./algorithms/python/LongestContinuousIncreasingSubsequence/findLengthOfLCIS.py)|Easy| |672|[Bulb Switcher II] | [C] ./algorithms/cpp/bulbSwitcher/BulbSwitcher.II.cpp)|Medium| |671|[Second Minimum Node In a Binary Tree] | [Python] ./algorithms/python/SecondMinimumNodeInABinaryTree/findSecondMinimumValue.py)|Easy| |665|[Non-decreasing Array] | [Python] ./algorithms/python/Non-decreasingArray/checkPossibility.py)|Easy| |662|[Maximum Width of Binary Tree] | [Python] ./algorithms/python/MaximumWidthOfBinaryTree/widthOfBinaryTree.py)|Medium| |661|[Image Smoother] | [Python] ./algorithms/python/ImageSmoother/imageSmoother.py)|Easy| |655|[Print Binary Tree] | [Python] ./algorithms/python/PrintBinaryTree/printTree.py)|Medium| |652|[Find Duplicate Subtrees] | [Python] ./algorithms/python/FindDuplicateSubtrees/findDuplicateSubtrees.py)|Medium| |647|[Palindromic Substrings] | [C] ./algorithms/cpp/palindromicSubstrings/PalindromicSubstrings.cpp)|Medium| |643|[Maximum Average Subarray I] | [C] ./algorithms/cpp/maximumAverageSubarray/MaximumAverageSubarray.I.cpp), [Python] ./algorithms/python/MaximumAverageSubarrayI/findMaxAverage.py)|Easy| |628|[Maximum Product of Three Numbers] | [Python] ./algorithms/python/MaximumProductOfThreeNumbers/maximumProduct.py)|Easy| |623|[Add One Row to Tree] | [Python] ./algorithms/python/AddOneRowToTree/addOneRow.py)|Medium| |581|[Shortest Unsorted Continuous Subarray] | [Python] ./algorithms/python/ShortestUnsortedContinuousSubarray/findUnsortedSubarray.py)|Easy| |572|[Subtree of Another Tree] | [Python] ./algorithms/python/SubtreeOfAnotherTree/isSubtree.py)|Easy| |563|[Binary Tree Tilt] | [Python] ./algorithms/python/BinaryTreeTilt/findTilt.py)|Easy| |547|[Friend Circles] | [C] ./algorithms/cpp/friendCircles/FriendCircles.cpp)|Medium| |543|[Diameter of Binary Tree] | [Python] ./algorithms/python/DiameterOfBinaryTree/diameterOfBinaryTree.py)|Easy| |538|[Convert BST to Greater Tree] | [Python] ./algorithms/python/ConvertBSTtoGreaterTree/convertBST.py)|Easy| |532|[K-diff Pairs in an Array] | [Python] ./algorithms/python/K-diffPairsInAnArray/findPairs.py)|Easy| |520|[Detect Capital] | [C] ./algorithms/cpp/detectCapital/DetectCapital.cpp)|Easy| |518|[Coin Change 2] | [C] ./algorithms/cpp/coinChange/CoinChange2.cpp)|Medium| |516|[Longest Palindromic Subsequence] | [C] ./algorithms/cpp/longestPalindromicSubsequence/LongestPalindromicSubsequence.cpp)|Medium| |509|[Fibonacci Number] | [C] ./algorithms/cpp/fibonacciNumber/FibonacciNumber.cpp), [Python] ./algorithms/python/FibonacciNumber/fib.py)|Easy| |497|[Random Point in Non-overlapping Rectangles] | [C] ./algorithms/cpp/randomPointInNonOverlappingRectangles/randomPointInNonOverlappingRectangles.cpp)|Medium| |494|[Target Sum] | [C] ./algorithms/cpp/targetSum/targetSum.cpp)|Medium| |477|[Total Hamming Distance] | [C] ./algorithms/cpp/totalHammingDistance/totalHammingDistance.cpp)|Medium| |463|[Island Perimeter] | [C] ./algorithms/cpp/islandPerimeter/IslandPerimeter.cpp)|Easy| |450|[DeleteNodeInABST] | [Python] ./algorithms/python/DeleteNodeInABST/deleteNode.py)|Medium| |449|[Serialize and Deserialize BST] | [Python] ./algorithms/python/SerializeAndDeserializeBST/serialize.py)|Medium| |438|[Find all Anagrams in a string] | [C] ./algorithms/cpp/findAllAnagramsInAString/Find-All-Anagrams-in-a-String.cpp)|Medium| |437|[Path Sum III] | [Python] ./algorithms/python/PathSumIII/pathSum.py)|Medium| |418|[SentenceScreenFitting] | [C] ./algorithms/cpp/sentenceScreenFitting/sentenceScreenFitting.cpp)|Easy| |416|[Partition Equal Subset Sum] | [C] ./algorithms/cpp/partitionEqualSubsetSum/PartitionEqualSubsetSum.cpp)|Medium| |415|[Add Strings] | [C] ./algorithms/cpp/addStrings/AddStrings.cpp)|Easy| |414|[Third Maximum Number] | [C] ./algorithms/cpp/thirdMaximumNumber/ThirdMaximumNumber.cpp), [Python] ./algorithms/python/ThirdMaximumNumber/thirdMax.py)|Easy| |413|[Arithmetic Slices] | [C] ./algorithms/cpp/arithmeticSlices/ArithmeticSlices.cpp)|Medium| |412|[Fizz Buzz] | [C] ./algorithms/cpp/fizzBuzz/FizzBuzz.cpp)|Easy| |410|[Split Array Largest Sum] | [C] ./algorithms/cpp/splitArrayLargestSum/SplitArrayLargestSum.cpp)|Hard| |409|[Longest Palindrome] | [C] ./algorithms/cpp/longestPalindrome/LongestPalindrome.cpp)|Easy| |406|[Queue Reconstruction by Height] | [C] ./algorithms/cpp/queueReconstructionByHeight/QueueReconstructionByHeight.cpp)|Medium| |405|[Convert a Number to Hexadecimal] | [C] ./algorithms/cpp/convertANumberToHexadecimal/ConvertANumberToHexadecimal.cpp)|Easy| |404|[Sum of Left Leaves] | [C] ./algorithms/cpp/sumOfLeftLeaves/SumOfLeftLeaves.cpp), [Python] ./algorithms/python/SumOfLeftLeaves/sumOfLeftLeaves.py)|Easy| |403|[Frog Jump] | [C] ./algorithms/cpp/frogJump/FrogJump.cpp)|Hard| |402|[Remove K Digits] | [C] ./algorithms/cpp/removeKDigits/RemoveKDigits.cpp)|Medium| |401|[Binary Watch] | [C] ./algorithms/cpp/binaryWatch/BinaryWatch.cpp)|Easy| |400|[Nth Digit] | [C] ./algorithms/cpp/nthDigit/NthDigit.cpp)|Medium| |399|[Evaluate Division] | [C] ./algorithms/cpp/evaluateDivision/EvaluateDivision.cpp)|Medium| |398|[Random Pick Index] | [C] ./algorithms/cpp/randomPickIndex/RandomPickIndex.cpp)|Medium| |397|[Integer Replacement] | [C] ./algorithms/cpp/integerReplacement/IntegerReplacement.cpp)|Medium| |396|[Rotate Function] | [C] ./algorithms/cpp/rotateFunction/RotateFunction.cpp)|Easy| |395|[Longest Substring with At Least K Repeating Characters] | [C] ./algorithms/cpp/longestSubstringWithAtLeastKRepeatingCharacters/LongestSubstringWithAtLeastKRepeatingCharacters.cpp)|Medium| |394|[Decode String] | [C] ./algorithms/cpp/decodeString/DecodeString.cpp)|Medium| |393|[UTF-8 Validation] | [C] ./algorithms/cpp/UTF8Validation/UTF8Validation.cpp)|Medium| |392|[Is Subsequence] | [C] ./algorithms/cpp/isSubsequence/IsSubsequence.cpp)|Medium| |391|[Perfect Rectangle] | [C] ./algorithms/cpp/perfectRectangle/PerfectRectangle.cpp)|Hard| |390|[Elimination Game] | [C] ./algorithms/cpp/eliminationGame/EliminationGame.cpp)|Medium| |389|[Find the Difference] | [C] ./algorithms/cpp/findTheDifference/FindTheDifference.cpp)|Easy| |388|[Longest Absolute File Path] | [C] ./algorithms/cpp/longestAbsoluteFilePath/LongestAbsoluteFilePath.cpp)|Medium| |387|[First Unique Character in a String] | [C] ./algorithms/cpp/firstUniqueCharacterInAString/FirstUniqueCharacterInAString.cpp)|Easy| |386|[Lexicographical Numbers] | [C] ./algorithms/cpp/lexicographicalNumbers/LexicographicalNumbers.cpp)|Medium| |385|[Mini Parser] | [C] ./algorithms/cpp/miniParser/MiniParser.cpp)|Medium| |384|[Shuffle an Array] | [C] ./algorithms/cpp/shuffleAnArray/ShuffleAnArray.cpp)|Medium| |383|[Ransom Note] | [C] ./algorithms/cpp/ransomNote/RansomNote.cpp)|Easy| |382|[Linked List Random Node] | [C] ./algorithms/cpp/linkedListRandomNode/LinkedListRandomNode.cpp)|Medium| |381|[Insert Delete GetRandom O(1) - Duplicates allowed] | [C] ./algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1DuplicatesAllowed.cpp)|Hard| |380|[Insert Delete GetRandom O(1)] | [C] ./algorithms/cpp/insertDeleteGetRandom/InsertDeleteGetrandomO1.cpp)|Hard| |377|[Combination Sum IV] | [C] ./algorithms/cpp/combinationSumIV/combinationSumIV.cpp)|Medium| |376|[Wiggle Subsequence] | [C] ./algorithms/cpp/wiggleSubsequence/wiggleSubsequence.cpp)|Medium| |371|[Sum of Two Integers] | [C] ./algorithms/cpp/sumOfTwoIntegers/SumOfTwoIntegers.cpp)|Easy| |367|[Valid Perfect Square] | [C] ./algorithms/cpp/validPerfectSquare/ValidPerfectSquare.cpp)|Easy| |357|[Count Numbers with Unique Digits] | [C] ./algorithms/cpp/countNumbersWithUniqueDigits/CountNumbersWithUniqueDigits.cpp)|Medium| |350|[Intersection of Two Arrays II] | [C] ./algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArraysII.cpp)|Easy| |349|[Intersection of Two Arrays] | [C] ./algorithms/cpp/intersectionOfTwoArrays/intersectionOfTwoArrays.cpp)|Easy| |347|[Top K Frequent Elements] | [C] ./algorithms/cpp/topKFrequentElements/topKFrequentElements.cpp)|Medium| |345|[Reverse Vowels of a String] | [C] ./algorithms/cpp/reverseVowelsOfAString/reverseVowelsOfAString.cpp)|Easy| |344|[Reverse String] | [C] ./algorithms/cpp/reverseString/ReverseString.cpp)|Easy| |343|[Integer Break] | [C] ./algorithms/cpp/integerBreak/IntegerBreak.cpp)|Medium| |342|[Power of Four] | [C] ./algorithms/cpp/powerOfFour/PowerOfFour.cpp)|Easy| |341|[Flatten Nested List Iterator] | [C] ./algorithms/cpp/flattenNestedListIterator/FlattenNestedListIterator.cpp)|Medium| |338|[Counting Bits] | [C] ./algorithms/cpp/countingBits/CountingBits.cpp)|Medium| |337|[House Robber III] | [C] ./algorithms/cpp/houseRobber/houseRobberIII.cpp), [Python] ./algorithms/python/HouseRobberIII/rob.py)|Medium| |336|[Palindrome Pairs] | [C] ./algorithms/cpp/palindromePairs/PalindromePairs.cpp)|Hard| |334|[Increasing Triplet Subsequence] | [C] ./algorithms/cpp/increasingTripletSubsequence/increasingTripletSubsequence.cpp)|Medium| |332|[Reconstruct Itinerary] | [C] ./algorithms/cpp/reconstructItinerary/ReconstructItinerary.cpp)|Medium| |331|[Verify Preorder Serialization of a Binary Tree] | [C] ./algorithms/cpp/verifyPreorderSerializationOfABinaryTree/VerifyPreorderSerializationOfABinaryTree.cpp)|Medium| |330|[Patching Array] | [C] ./algorithms/cpp/patchingArray/PatchingArray.cpp)|Medium| |329|[Longest Increasing Path in a Matrix] | [C] ./algorithms/cpp/longestIncreasingPathInAMatrix/LongestIncreasingPathInAMatrix.cpp)|Medium| |328|[Odd Even Linked List] | [C] ./algorithms/cpp/oddEvenLinkedList/OddEvenLinkedList.cpp)|Easy| |327|[Count of Range Sum] | [C] ./algorithms/cpp/countOfRangeSum/CountOfRangeSum.cpp)|Hard| |326|[Power of Three] | [C] ./algorithms/cpp/powerOfThree/PowerOfThree.cpp)|Easy| |324|[Wiggle Sort II] | [C] ./algorithms/cpp/wiggleSort/WiggleSort.II.cpp)|Medium| |322|[Coin Change] | [C] ./algorithms/cpp/coinChange/coinChange.cpp)|Medium| |321|[Create Maximum Number] | [C] ./algorithms/cpp/createMaximumNumber/CreateMaximumNumber.cpp)|Hard| |319|[Bulb Switcher] | [C] ./algorithms/cpp/bulbSwitcher/bulbSwitcher.cpp)|Medium| |318|[Maximum Product of Word Lengths] | [C] ./algorithms/cpp/maximumProductOfWordLengths/MaximumProductOfWordLengths.cpp)|Medium| |316|[Remove Duplicate Letters] | [C] ./algorithms/cpp/removeDuplicateLetters/RemoveDuplicateLetters.cpp)|Hard| |315|[Count of Smaller Numbers After Self] | [C] ./algorithms/cpp/countOfSmallerNumbersAfterSelf/countOfSmallerNumbersAfterSelf.cpp)|Hard| |313|[Super Ugly Number] | [C] ./algorithms/cpp/superUglyNumber/SuperUglyNumber.cpp)|Medium| |312|[Burst Balloons] | [C] ./algorithms/cpp/burstBalloons/BurstBalloons.cpp)|Hard| |310|[Minimum Height Trees] | [C] ./algorithms/cpp/minimumHeightTrees/MinimumHeightTrees.cpp)|Medium| |309|[Best Time to Buy and Sell Stock with Cooldown] | [C] ./algorithms/cpp/bestTimeToBuyAndSellStock/BestTimeToBuyAndSellStockWithCooldown.cpp)|Medium| |307|[Range Sum Query - Mutable] | [C] ./algorithms/cpp/rangeSumQuery-Immutable/rangeSumQuery-Mutable/RangeSumQueryMutable.cpp)|Medium| |306|[Additive Number] | [C] ./algorithms/cpp/additiveNumber/AdditiveNumber.cpp)|Medium| |304|[Range Sum Query 2D - Immutable] | [C] ./algorithms/cpp/rangeSumQuery2D-Immutable/RangeSumQuery2dImmutable.cpp)|Medium| |303|[Range Sum Query - Immutable] | [C] ./algorithms/cpp/rangeSumQuery-Immutable/rangeSumQuery-Immutable.cpp)|Easy| |301|[Remove Invalid Parentheses] | [C] ./algorithms/cpp/removeInvalidParentheses/RemoveInvalidParentheses.cpp) |Hard| |300|[Longest Increasing Subsequence] | [C] ./algorithms/cpp/longestIncreasingSubsequence/longestIncreasingSubsequence.cpp)|Medium| |299|[Bulls and Cows] | [C] ./algorithms/cpp/bullsAndCows/bullsAndCows.cpp)|Easy| |297|[Serialize and Deserialize Binary Tree] | [C] ./algorithms/cpp/serializeAndDeserializeBinaryTree/SerializeAndDeserializeBinaryTree.cpp)|Medium| |295|[Find Median from Data Stream] | [C] ./algorithms/cpp/findMedianFromDataStream/FindMedianFromDataStream.cpp)|Hard| |292|[Nim Game] | [C] ./algorithms/cpp/nimGame/nimGame.cpp)|Easy| |290|[Word Pattern] | [C] ./algorithms/cpp/wordPattern/WordPattern.cpp)|Easy| |289|[Game of Life] | [C] ./algorithms/cpp/gameOfLife/GameOfLife.cpp)|Medium| |287|[Find the Duplicate Number] | [C] ./algorithms/cpp/findTheDuplicateNumber/findTheDuplicateNumber.cpp), [Python] ./algorithms/python/FindTheDuplicateNumber/findDuplicate.py)|Hard| |285|[Inorder Successor in BST] | [Java] ./algorithms/java/src/inorderSuccessorInBST/inorderSuccessorInBST.java)|Medium| |284|[Peeking Iterator] | [C] ./algorithms/cpp/peekingIterator/PeekingIterator.cpp)|Medium| |283|[Move Zeroes] | [C] ./algorithms/cpp/moveZeroes/moveZeroes.cpp)|Easy| |282|[Expression Add Operators] | [C] ./algorithms/cpp/expressionAddOperators/ExpressionAddOperators.cpp)|Hard| |279|[Perfect Squares] | [C] ./algorithms/cpp/perfectSquares/PerfectSquares.cpp)|Medium| |278|[First Bad Version] [C] ./algorithms/cpp/firstBadVersion/FirstBadVersion.cpp), [Java] ./algorithms/java/src/firstBadVersion/firstBadVersion.java)|Easy| |275|[H-Index II] [C] ./algorithms/cpp/h-Index/h-Index.II.cpp)|Medium| |274|[H-Index] [C] ./algorithms/cpp/h-Index/h-Index.cpp)|Medium| |273|[Integer to English Words] [C] ./algorithms/cpp/integerToEnglishWords/IntegerToEnglishWords.cpp)|Medium| |268|[Missing Number] [C] ./algorithms/cpp/missingNumber/MissingNumber.cpp)|Medium| |264|[Ugly Number II] [C] ./algorithms/cpp/uglyNumber/UglyNumber.II.cpp)|Medium| |263|[Ugly Number] [C] ./algorithms/cpp/uglyNumber/UglyNumber.cpp)|Easy| |260|[Single Number III] [C] ./algorithms/cpp/singleNumber/singleNumber.III.cpp)|Medium| |258|[Add Digits] [C] ./algorithms/cpp/addDigits/addDigits.cpp)|Easy| |257|[Binary Tree Paths] [C] ./algorithms/cpp/binaryTreePaths/binaryTreePaths.cpp)|Easy| |242|[Valid Anagram] [C] ./algorithms/cpp/anagrams/ValidAnagram.cpp), [Java] ./algorithms/java/src/validAnagram/ValidAnagram.java)|Easy| |241|[Different Ways to Add Parentheses] C(./algorithms/cpp/differentWaysToAddParentheses/DifferentWaysToAddParentheses.cpp), [Python] ./algorithms/python/DifferentWaysToAddParentheses/diffWaysToCompute.py)|Medium| |240|[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] [C] ./algorithms/cpp/slidingWindowMaximum/SlidingWindowMaximum.cpp)|Hard| |238|[Product of Array Except Self] [C] ./algorithms/cpp/productOfArrayExceptSelf/ProductOfArrayExceptSelf.cpp)|Medium| |237|[Delete Node in a Linked List] [C] ./algorithms/cpp/deleteNodeInALinkedList/DeleteNodeInALinkedList.cpp)|Easy| |236|[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] [C] ./algorithms/cpp/lowestCommonAncestorOfABinarySearchTree/LowestCommonAncestorOfABinarySearchTree.cpp), [Python] ./algorithms/python/LowestCommonAncestorOfABinarySearchTree/lowestCommonAncestor.py)|Easy| |234|[Palindrome Linked List] [C] ./algorithms/cpp/palindromeLinkedList/PalindromeLinkedList.cpp)|Easy| |233|[Number of Digit One] [C] ./algorithms/cpp/numberOfDigitOne/NumberOfDigitOne.cpp)|Medium| |232|[Implement Queue using Stacks] [C] ./algorithms/cpp/implementQueueUsingStacks/ImplementQueueUsingStacks.cpp), [Java] ./algorithms/java/src/myQueue/MyQueue.java)|Easy| |231|[Power of Two] [C] ./algorithms/cpp/powerOfTwo/PowerOfTwo.cpp)|Easy| |230|[Kth Smallest Element in a BST] [C] ./algorithms/cpp/kthSmallestElementInaBST/KthSmallestElementInABst.cpp), [Python] ./algorithms/python/KthSmallestElementInABST/kthSmallest.py)|Medium| |229|[Majority Element II] | [C] ./algorithms/cpp/majorityElement/majorityElement.II.cpp)|Medium| |228|[Summary Ranges] [C] ./algorithms/cpp/summaryRanges/SummaryRanges.cpp)|Easy| |227|[Basic Calculator II] [C] ./algorithms/cpp/basicCalculator/BasicCalculator.II.cpp)|Medium| |226|[Invert Binary Tree] [C] ./algorithms/cpp/invertBinaryTree/InvertBinaryTree.cpp)|Easy| |225|[Implement Stack using Queues] [C] ./algorithms/cpp/implementStackUsingQueues/ImplementStackUsingQueues.cpp), [Java] ./algorithms/java/src/myStack/MyStack.java)|Medium| |224|[Basic Calculator] [C] ./algorithms/cpp/basicCalculator/BasicCalculator.cpp)|Medium| |223|[Rectangle Area] [C] ./algorithms/cpp/rectangleArea/RectangleArea.cpp)|Easy| |222|[Count Complete Tree Nodes] [C] ./algorithms/cpp/countCompleteTreeNodes/CountCompleteTreeNodes.cpp), [Python] ./algorithms/python/CountCompleteTreeNodes/countNodes.py)|Medium| |221|[Maximal Square] [C] ./algorithms/cpp/maximalSquare/MaximalSquare.cpp)|Medium| |220|[Contains Duplicate III] [C] ./algorithms/cpp/containsDuplicate/ContainsDuplicate.III.cpp), [Python] ./algorithms/python/ContainsDuplicateIII/containsNearbyAlmostDuplicate.py)|Medium| |219|[Contains Duplicate II] [C] ./algorithms/cpp/containsDuplicate/ContainsDuplicate.II.cpp), [Python] ./algorithms/python/ContainsDuplicateII/containsNearbyDuplicate.py)|Easy| |218|[The Skyline Problem] [C] ./algorithms/cpp/theSkylineProblem/TheSkylineProblem.cpp)|Hard| |217|[Contains Duplicate] [C] ./algorithms/cpp/containsDuplicate/ContainsDuplicate.cpp)|Easy| |216|[Combination Sum III] [C] ./algorithms/cpp/combinationSum/combinationSum.III.cpp)|Medium| |215|[Kth Largest Element in an Array] [C] ./algorithms/cpp/kthLargestElementInAnArray/KthLargestElementInAnArray.cpp)|Medium| |214|[Shortest Palindrome] [C] ./algorithms/cpp/shortestPalindrome/ShortestPalindrome.cpp)|Hard| |213|[House Robber II] [C] ./algorithms/cpp/houseRobber/houseRobber.II.cpp)|Medium| |212|[Word Search II] [C] ./algorithms/cpp/wordSearch/wordSearch.II.cpp)|Hard| |211|[Add and Search Word - Data structure design] [C] ./algorithms/cpp/addAndSearchWord/AddAndSearchWord.cpp)|Medium| |210|[Course Schedule II] [C] ./algorithms/cpp/courseSchedule/CourseSchedule.II.cpp)|Medium| |209|[Minimum Size Subarray Sum] [C] ./algorithms/cpp/minimumSizeSubarraySum/MinimumSizeSubarraySum.cpp)|Medium| |208|[Implement Trie (Prefix Tree)] [C] ./algorithms/cpp/implementTriePrefixTree/ImplementTriePrefixTree.cpp)|Medium| |207|[Course Schedule] [C] ./algorithms/cpp/courseSchedule/CourseSchedule.cpp)|Medium| |206|[Reverse Linked List] [C] ./algorithms/cpp/reverseLinkedList/reverseLinkedList.cpp), [Java] ./algorithms/java/src/reverseLinkedList/ReverseLinkedList.java)|Easy| |205|[Isomorphic Strings] [C] ./algorithms/cpp/isomorphicStrings/IsomorphicStrings.cpp)|Easy| |204|[Count Primes] [C] ./algorithms/cpp/countPrimes/CountPrimes.cpp)|Easy| |203|[Remove Linked List Elements] [C] ./algorithms/cpp/removeLinkedListElements/RemoveLinkedListElements.cpp)|Easy| |202|[Happy Number] [C] ./algorithms/cpp/happyNumber/HappyNumber.cpp), [Python] ./algorithms/python/HappyNumber/isHappy.py)|Easy| |201|[Bitwise AND of Numbers Range] [C] ./algorithms/cpp/bitwiseANDOfNumbersRange/BitwiseAndOfNumbersRange.cpp)|Medium| |200|[Number of Islands] [C] ./algorithms/cpp/numberOfIslands/NumberOfIslands.cpp), [Python] ./algorithms/python/NumberOfIslands/numIslands.py)|Medium| |199|[Binary Tree Right Side View] [C] ./algorithms/cpp/binaryTreeRightSideView/binaryTreeRightSideView.cpp)|Medium| |198|[House Robber] [C] ./algorithms/cpp/houseRobber/houseRobber.cpp), [Python] ./algorithms/python/HouseRobber/rob.py)|Easy| |191|[Number of 1 Bits] [C] ./algorithms/cpp/numberOf1Bits/numberOf1Bits.cpp)|Easy| |190|[Reverse Bits] [C] ./algorithms/cpp/reverseBits/reverseBits.cpp)|Easy| |189|[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] [C] ./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.IV.cpp)|Hard| |187|[Repeated DNA Sequences] [C] ./algorithms/cpp/repeatedDNASequences/repeatedDNASequences.cpp)|Medium| |186|[Reverse Words in a String II] | [C] ./algorithms/cpp/reverseWordsInAString/reverseWordsInAString.II.cpp)|Medium| |179|[Largest Number] | [C] ./algorithms/cpp/largestNumber/largestNumber.cpp)|Medium| |174|[Dungeon Game] | [C] ./algorithms/cpp/dungeonGame/dungeonGame.cpp)|Hard| |173|[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] | [C] ./algorithms/cpp/factorialTrailingZeroes/factorialTrailingZeroes.cpp)|Easy| |171|[Excel Sheet Column Number] | [C] ./algorithms/cpp/excelSheetColumnNumber/excelSheetColumnNumber.cpp)|Easy| |170|[Two Sum III - Data structure design] | [C] ./algorithms/cpp/twoSum/twoSum.III.cpp)|Easy| |169|[Majority Element] | [C] ./algorithms/cpp/majorityElement/majorityElement.cpp)|Easy| |168|[Excel Sheet Column Title] | [C] ./algorithms/cpp/excelSheetColumnTitle/excelSheetColumnTitle.cpp)|Easy| |167|[Two Sum II - Input array is sorted] | [C] ./algorithms/cpp/twoSum/twoSum.II.cpp)|Medium| |166|[Fraction to Recurring Decimal] | [C] ./algorithms/cpp/fractionToRecurringDecimal/fractionToRecurringDecimal.cpp)|Medium| |165|[Compare Version Numbers] | [C] ./algorithms/cpp/compareVersionNumbers/compareVersionNumbers.cpp)|Easy| |164|[Maximum Gap] | [C] ./algorithms/cpp/maximumGap/maximumGap.cpp)|Hard| |163|[Missing Ranges] | [C] ./algorithms/cpp/missingRanges/missingRanges.cpp)|Medium| |162|[Find Peak Element] | [C] ./algorithms/cpp/findPeakElement/findPeakElement.cpp), [Java] ./algorithms/java/src/findPeakElement/findPeakElement.java)|Medium| |161|[One Edit Distance] | [C] ./algorithms/cpp/oneEditDistance/oneEditDistance.cpp)|Medium| |160|[Intersection of Two Linked Lists] | [C] ./algorithms/cpp/intersectionOfTwoLinkedLists/intersectionOfTwoLinkedLists.cpp)|Easy| |159|[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] | [C] ./algorithms/cpp/readNCharactersGivenRead4/readNCharactersGivenRead4.II.cpp)|Hard| |157|[Read N Characters Given Read4] | [C] ./algorithms/cpp/readNCharactersGivenRead4/readNCharactersGivenRead4.cpp)|Easy| |156|[Binary Tree Upside Down] | [C] ./algorithms/cpp/binaryTreeUpsideDown/binaryTreeUpsideDown.cpp)|Medium| |155|[Min Stack] [C] ./algorithms/cpp/minStack/minStack.cpp), [Java] ./algorithms/java/src/minStack/MinStack.java)|Easy| |154|[Find Minimum in Rotated Sorted Array II] [C] ./algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.II.cpp)|Hard| |153|[Find Minimum in Rotated Sorted Array] [C] ./algorithms/cpp/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.cpp), [Java] ./algorithms/java/src/findMinimumInRotatedSortedArray/findMinimumInRotatedSortedArray.java)|Medium| |152|[Maximum Product Subarray] [C] ./algorithms/cpp/maximumProductSubarray/maximumProductSubarray.cpp)|Medium| |151|[Reverse Words in a String] [C] ./algorithms/cpp/reverseWordsInAString/reverseWordsInAString.cpp), [Java] ./algorithms/java/src/reverseWordsInAString/ReverseWordsInAString.java)|Medium| |150|[Evaluate Reverse Polish Notation] [C] ./algorithms/cpp/evaluateReversePolishNotation/evaluateReversePolishNotation.cpp)|Medium| |149|[Max Points on a Line] [C] ./algorithms/cpp/maxPointsOnALine/maxPointsOnALine.cpp)|Hard| |148|[Sort List] [C] ./algorithms/cpp/sortList/sortList.cpp), [Python] ./algorithms/python/SortList/sortList.py)|Medium| |147|[Insertion Sort List] [C] ./algorithms/cpp/insertionSortList/insertionSortList.cpp), [Python] ./algorithms/python/InsertionSortList/insertionSortList.py)|Medium| |146|[LRU Cache] [C] ./algorithms/cpp/LRUCache/LRUCache.cpp), [Java] ./algorithms/java/src/lruCache/LRUCache.java)|Hard| |145|[Binary Tree Postorder Traversal] [C] ./algorithms/cpp/binaryTreePostorderTraversal/binaryTreePostorderTraversal.cpp), [Python] ./algorithms/python/BinaryTreePostorderTraversal/postorderTraversal.py)|Hard| |144|[Binary Tree Preorder Traversal] [C] ./algorithms/cpp/binaryTreePreorderTraversal/binaryTreePreorderTraversal.cpp), [Java] ./algorithms/java/src/binaryTreePreorderTraversal/binaryTreePreorderTraversal.java)|Medium| |143|[Reorder List] [C] ./algorithms/cpp/reorderList/reorderList.cpp), [Python] ./algorithms/python/ReorderList/reorderList.py)|Medium| |142|[Linked List Cycle II] [C] ./algorithms/cpp/linkedListCycle/linkedListCycle.II.cpp), [Python] ./algorithms/python/LinkedListCycleII/detectCycle.py)|Medium| |141|[Linked List Cycle] [C] ./algorithms/cpp/linkedListCycle/linkedListCycle.cpp)|Medium| |140|[Word Break II] [C] ./algorithms/cpp/wordBreak/wordBreak.II.cpp)|Hard| |139|[Word Break] [C] ./algorithms/cpp/wordBreak/wordBreak.cpp)|Medium| |138|[Copy List with Random Pointer] [C] ./algorithms/cpp/copyListWithRandomPointer/copyListWithRandomPointer.cpp), [Python] ./algorithms/python/CopyListWithRandomPointer/copyRandomList.py)|Hard| |137|[Single Number II] [C] ./algorithms/cpp/singleNumber/singleNumber.II.cpp)|Medium| |136|[Single Number] [C] ./algorithms/cpp/singleNumber/singleNumber.cpp)|Medium| |135|[Candy] [C] ./algorithms/cpp/candy/candy.cpp)|Hard| |134|[Gas Station] [C] ./algorithms/cpp/gasStation/gasStation.cpp)|Medium| |133|[Clone Graph] [C] ./algorithms/cpp/cloneGraph/cloneGraph.cpp)|Medium| |132|[Palindrome Partitioning II] [C] ./algorithms/cpp/palindromePartitioning/palindromePartitioning.II.cpp)|Hard| |131|[Palindrome Partitioning] [C] ./algorithms/cpp/palindromePartitioning/palindromePartitioning.cpp)|Medium| |130|[Surrounded Regions] [C] ./algorithms/cpp/surroundedRegions/surroundedRegions.cpp)|Medium| |129|[Sum Root to Leaf Numbers] [C] ./algorithms/cpp/sumRootToLeafNumber/sumRootToLeafNumber.cpp), [Python] ./algorithms/python/SumRootToLeafNumbers/sumNumbers.py)|Medium| |128|[Longest Consecutive Sequence] [C] ./algorithms/cpp/longestConsecutiveSequence/longestConsecutiveSequence.cpp)|Hard| |127|[Word Ladder] [C] ./algorithms/cpp/wordLadder/wordLadder.cpp)|Medium| |126|[Word Ladder II] [C] ./algorithms/cpp/wordLadder/wordLadder.II.cpp)|Hard| |125|[Valid Palindrome] [C] ./algorithms/cpp/validPalindrome/validPalindrome.cpp), [Java] ./algorithms/java/src/validPalindrome/ValidPalindrome.java)|Easy| |124|[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] [C] ./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.III.cpp)|Hard| |122|[Best Time to Buy and Sell Stock II] [C] ./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.II.cpp)|Medium| |121|[Best Time to Buy and Sell Stock] [C] ./algorithms/cpp/bestTimeToBuyAndSellStock/bestTimeToBuyAndSellStock.cpp)|Medium| |120|[Triangle] [C] ./algorithms/cpp/triangle/triangle.cpp), [Java] ./algorithms/java/src/dynamicProgramming/triangle/triangle.java)|Medium| |119|[Pascal’s Triangle II] [C] ./algorithms/cpp/pascalTriangle/pascalTriangle.II.cpp)|Easy| |118|[Pascal’s Triangle] [C] ./algorithms/cpp/pascalTriangle/pascalTriangle.cpp)|Easy| |117|[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] [C] ./algorithms/cpp/populatingNextRightPointersInEachNode/populatingNextRightPointersInEachNode.cpp), [Python] ./algorithms/python/PopulatingNextRightPointersInEachNode/connect.py)|Medium| |115|[Distinct Subsequences] [C] ./algorithms/cpp/distinctSubsequences/distinctSubsequences.cpp)|Hard| |114|[Flatten Binary Tree to Linked List] [C] ./algorithms/cpp/flattenBinaryTreeToLinkedList/flattenBinaryTreeToLinkedList.cpp), [Python] ./algorithms/python/FlattenBinaryTreeToLinkedList/flatten.py)|Medium| |113|[Path Sum II] [C] ./algorithms/cpp/pathSum/pathSum.II.cpp), [Python] ./algorithms/python/PathSumII/pathSum.py)|Medium| |112|[Path Sum] [C] ./algorithms/cpp/pathSum/pathSum.cpp)|Easy| |111|[Minimum Depth of Binary Tree] [C] ./algorithms/cpp/minimumDepthOfBinaryTree/minimumDepthOfBinaryTree.cpp)|Easy| |110|[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] [C] ./algorithms/cpp/convertSortedListToBinarySearchTree/convertSortedListToBinarySearchTree.cpp)|Medium| |108|[Convert Sorted Array to Binary Search Tree] [C] ./algorithms/cpp/convertSortedArrayToBinarySearchTree/convertSortedArrayToBinarySearchTree.cpp)|Medium| |107|[Binary Tree Level Order Traversal II] [C] ./algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.II.cpp)|Easy| |106|[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] [C] ./algorithms/cpp/constructBinaryTreeFromPreorderAndInorderTraversal/constructBinaryTreeFromPreorderAndInorderTraversal.cpp), [Python] ./algorithms/python/ConstructBinaryTreeFromPreorderAndInorderTraversal/buildTree.py)|Medium| |104|[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] [C] ./algorithms/cpp/binaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cpp), [Python] ./algorithms/python/BinaryTreeZigzagLevelOrderTraversal/zigzagLevelOrder.py)|Medium| |102|[Binary Tree Level Order Traversal] [C] ./algorithms/cpp/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.cpp), [Java] ./algorithms/java/src/binaryTreeLevelOrderTraversal/binaryTreeLevelOrderTraversal.java)|Easy| |101|[Symmetric Tree] [C] ./algorithms/cpp/symmetricTree/symmetricTree.cpp)|Easy| |100|[Same Tree] [C] ./algorithms/cpp/sameTree/sameTree.cpp)|Easy| |99|[Recover Binary Search Tree] [C] ./algorithms/cpp/recoverBinarySearchTree/recoverBinarySearchTree.cpp)|Hard| |98|[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] [C] ./algorithms/cpp/interleavingString/interleavingString.cpp)|Hard| |96|[Unique Binary Search Trees] [C] ./algorithms/cpp/uniqueBinarySearchTrees/uniqueBinarySearchTrees.cpp), [Python] ./algorithms/python/UniqueBinarySearchTrees/numTrees.py)|Medium| |95|[Unique Binary Search Trees II] [C] ./algorithms/cpp/uniqueBinarySearchTrees/uniqueBinarySearchTrees.II.cpp), [Python] ./algorithms/python/UniqueBinarySearchTreesII/generateTrees.py)|Medium| |94|[Binary Tree Inorder Traversal] [C] ./algorithms/cpp/binaryTreeInorderTraversal/binaryTreeInorderTraversal.cpp)|Medium| |93|[Restore IP Addresses] [C] ./algorithms/cpp/restoreIPAddresses/restoreIPAddresses.cpp)|Medium| |92|[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] [C] ./algorithms/cpp/decodeWays/decodeWays.cpp)|Medium| |90|[Subsets II] [C] ./algorithms/cpp/subsets/subsets.II.cpp), [Java] ./algorithms/java/src/subsets/subsetsII.java)|Medium| |89|[Gray Code] [C] ./algorithms/cpp/grayCode/grayCode.cpp)|Medium| |88|[Merge Sorted Array] [C] ./algorithms/cpp/mergeTwoSortedArray/mergeTwoSortedArray.cpp)|Easy| |87|[Scramble String] [C] ./algorithms/cpp/scrambleString/scrambleString.cpp)|Hard| |86|[Partition List] [C] ./algorithms/cpp/partitionList/partitionList.cpp), [Python] ./algorithms/python/PartitionList/partition.py)|Medium| |85|[Maximal Rectangle] [C] ./algorithms/cpp/maximalRectangle/maximalRectangle.cpp)|Hard| |84|[Largest Rectangle in Histogram] [C] ./algorithms/cpp/largestRectangleInHistogram/largestRectangleInHistogram.cpp)|Hard| |83|[Remove Duplicates from Sorted List] [C] ./algorithms/cpp/removeDuplicatesFromSortedList/removeDuplicatesFromSortedList.cpp)|Easy| |82|[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] [C] ./algorithms/cpp/searchInRotatedSortedArray/searchInRotatedSortedArray.II.cpp)|Medium| |80|[Remove Duplicates from Sorted Array II] [C] ./algorithms/cpp/removeDuplicatesFromSortedArray/removeDuplicatesFromSortedArray.II.cpp)|Medium| |79|[Word Search] [C] ./algorithms/cpp/wordSearch/wordSearch.cpp)|Medium| |78|[Subsets] [C] ./algorithms/cpp/subsets/subsets.cpp), [Java] ./algorithms/java/src/subsets/subsets.java), [Python] ./algorithms/python/Subsets/subsets.py)|Medium| |77|[Combinations] [C] ./algorithms/cpp/combinations/combinations.cpp)|Medium| |76|[Minimum Window Substring] [C] ./algorithms/cpp/minimumWindowSubstring/minimumWindowSubstring.cpp)|Hard| |75|[Sort Colors] [C] ./algorithms/cpp/sortColors/sortColors.cpp)|Medium| |74|[Search a 2D Matrix] [C] ./algorithms/cpp/search2DMatrix/search2DMatrix.cpp), [Java] ./algorithms/java/src/search2DMatrix/search2DMatrix.java)|Medium| |73|[Set Matrix Zeroes] [C] ./algorithms/cpp/setMatrixZeroes/setMatrixZeroes.cpp)|Medium| |72|[Edit Distance] [C] ./algorithms/cpp/editDistance/editDistance.cpp)|Hard| |71|[Simplify Path] [C] ./algorithms/cpp/simplifyPath/simplifyPath.cpp)|Medium| |70|[Climbing Stairs] [C] ./algorithms/cpp/climbStairs/climbStairs.cpp), [Java] ./algorithms/java/src/dynamicProgramming/climbStairs/climbStairs.java)|Easy| |69|[Sqrt(x)] [C] ./algorithms/cpp/sqrt/sqrt.cpp)|Medium| |68|[Text Justification] [C] ./algorithms/cpp/textJustification/textJustification.cpp)|Hard| |67|[Add Binary] [C] ./algorithms/cpp/addBinary/addBinary.cpp)|Easy| |66|[Plus One] [C] ./algorithms/cpp/plusOne/plusOne.cpp)|Easy| |65|[Valid Number] [C] ./algorithms/cpp/validNumber/validNumber.cpp)|Easy| |64|[Minimum Path Sum] [C] ./algorithms/cpp/minimumPathSum/minimumPathSum.cpp), [Java] ./algorithms/java/src/dynamicProgramming/minimumPathSum/minimumPathSum.java)|Medium| |63|[Unique Paths II] [C] ./algorithms/cpp/uniquePaths/uniquePaths.II.cpp), [Java] ./algorithms/java/src/dynamicProgramming/uniquePaths/uniquePathsII.java)|Medium| |62|[Unique Paths] [C] ./algorithms/cpp/uniquePaths/uniquePaths.cpp), [Java] ./algorithms/java/src/dynamicProgramming/uniquePaths/uniquePaths.java)|Medium| |61|[Rotate List] [C] ./algorithms/cpp/rotateList/rotateList.cpp)|Medium| |60|[Permutation Sequence] [C] ./algorithms/cpp/permutationSequence/permutationSequence.cpp)|Medium| |59|[Spiral Matrix II] [C] ./algorithms/cpp/spiralMatrix/spiralMatrix.II.cpp)|Medium| |58|[Length of Last Word] [C] ./algorithms/cpp/lengthOfLastWord/lengthOfLastWord.cpp), [Java] ./algorithms/java/src/lengthOfLastWord/LengthOfLastWord.java)|Easy| |57|[Insert Interval] [C] ./algorithms/cpp/insertInterval/insertInterval.cpp)|Hard| |56|[Merge Intervals] [C] ./algorithms/cpp/mergeIntervals/mergeIntervals.cpp)|Hard| |55|[Jump Game] [C] ./algorithms/cpp/jumpGame/jumpGame.cpp), [Python] ./algorithms/python/jumpGame/jumpGame.py)|Medium| |54|[Spiral Matrix] [C] ./algorithms/cpp/spiralMatrix/spiralMatrix.cpp)|Medium| |53|[Maximum Subarray] [C] ./algorithms/cpp/maximumSubArray/maximumSubArray.cpp), [Java] ./algorithms/java/src/MaxSubArray/MaxSubarray.java)|Medium| |52|[N-Queens II] [C] ./algorithms/cpp/nQueens/nQueuens.II.cpp)|Hard| |51|[N-Queens] [C] ./algorithms/cpp/nQueens/nQueuens.cpp)|Hard| |50|["Pow(x, n)"] [C] ./algorithms/cpp/pow/pow.cpp), [Java] ./algorithms/java/src/powXn/PowXn.java)|Medium| |49|[Group Anagrams] [C] ./algorithms/cpp/anagrams/GroupAnagrams.cpp)|Medium| |48|[Rotate Image] [C] ./algorithms/cpp/rotateImage/rotateImage.cpp)|Medium| |47|[Permutations II] [C] ./algorithms/cpp/permutations/permutations.II.cpp)|Hard| |46|[Permutations] [C] ./algorithms/cpp/permutations/permutations.cpp)|Medium| |45|[Jump Game II] [C] ./algorithms/cpp/jumpGame/jumpGame.II.cpp)|Hard| |44|[Wildcard Matching] [C] ./algorithms/cpp/wildcardMatching/wildcardMatching.cpp)|Hard| |43|[Multiply Strings] [C] ./algorithms/cpp/multiplyStrings/multiplyStrings.cpp)|Medium| |42|[Trapping Rain Water] [C] ./algorithms/cpp/trappingRainWater/trappingRainWater.cpp)|Hard| |41|[First Missing Positive] [C] ./algorithms/cpp/firstMissingPositive/firstMissingPositive.cpp), [Python] ././algorithms/python/firstMissingPositive/firstMissingPositive.py)|Hard| |40|[Combination Sum II] [C] ./algorithms/cpp/combinationSum/combinationSum.II.cpp)|Medium| |39|[Combination Sum] [C] ./algorithms/cpp/combinationSum/combinationSum.cpp)|Medium| |38|[Count and Say] [C] ./algorithms/cpp/countAndSay/countAndSay.cpp), [Java] ./algorithms/java/src/countAndSay/CountAndSay.java)|Easy| |37|[Sudoku Solver] [C] ./algorithms/cpp/sudokuSolver/sudokuSolver.cpp)|Hard| |36|[Valid Sudoku] [C] ./algorithms/cpp/validSudoku/validSudoku.cpp)|Easy| |35|[Search Insert Position] [C] ./algorithms/cpp/searchInsertPosition/searchInsertPosition.cpp), [Java] ./algorithms/java/src/searchInsertPosition/searchInsertPosition.java)|Medium| |34|[Search for a Range] [C] ./algorithms/cpp/searchForRange/searchForRange.cpp), [Java] ./algorithms/java/src/searchForRange/searchForRange.java)|Medium| |33|[Search in Rotated Sorted Array] [C] ./algorithms/cpp/searchInRotatedSortedArray/searchInRotatedSortedArray.cpp), [Java] ./algorithms/java/src/searchInRotatedSortedArray/searchInRotatedSortedArray.java)|Hard| |32|[Longest Valid Parentheses] [C] ./algorithms/cpp/longestValidParentheses/longestValidParentheses.cpp)|Hard| |31|[Next Permutation] [C] ./algorithms/cpp/nextPermutation/nextPermutation.cpp)|Medium| |30|[Substring with Concatenation of All Words] [C] ./algorithms/cpp/substringWithConcatenationOfAllWords/substringWithConcatenationOfAllWords.cpp)|Hard| |29|[Divide Two Integers] [C] ./algorithms/cpp/divideTwoInt/divideTwoInt.cpp)|Medium| |28|[Implement strStr()] [C] ./algorithms/cpp/strStr/strStr.cpp), [Java] ./algorithms/java/src/strStr/strStr.java)|Easy| |27|[Remove Element] [C] ./algorithms/cpp/removeElement/removeElement.cpp)|Easy| |26|[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] [C] ./algorithms/cpp/reverseNodesInKGroup/reverseNodesInKGroup.cpp)|Hard| |24|[Swap Nodes in Pairs] [C] ./algorithms/cpp/swapNodesInPairs/swapNodesInPairs.cpp)|Medium| |23|[Merge k Sorted Lists] [C] ./algorithms/cpp/mergeKSortedLists/mergeKSortedLists.cpp)|Hard| |22|[Generate Parentheses] [C] ./algorithms/cpp/generateParentheses/generateParentheses.cpp)|Medium| |21|[Merge Two Sorted Lists] [C] ./algorithms/cpp/mergeTwoSortedList/mergeTwoSortedList.cpp)|Easy| |20|[Valid Parentheses] [C] ./algorithms/cpp/validParentheses/validParentheses.cpp)|Easy| |19|[Remove Nth Node From End of List] [C] ./algorithms/cpp/removeNthNodeFromEndOfList/removeNthNodeFromEndOfList.cpp), [Python] ./algorithms/python/RemoveNthNodeFromEndOfList/removeNthFromEnd.py)|Easy| |18|[4Sum] [C] ./algorithms/cpp/4Sum/4Sum.cpp)|Medium| |17|[Letter Combinations of a Phone Number] [C] ./algorithms/cpp/letterCombinationsOfAPhoneNumber/letterCombinationsOfAPhoneNumber.cpp)|Medium| |16|[3Sum Closest] [C] ./algorithms/cpp/3SumClosest/3SumClosest.cpp)|Medium| |15|[3Sum] [C] ./algorithms/cpp/3Sum/3Sum.cpp)|Medium| |14|[Longest Common Prefix] [C] ./algorithms/cpp/longestCommonPrefix/longestCommonPrefix.cpp)|Easy| |13|[Roman to Integer] [C] ./algorithms/cpp/romanToInteger/romanToInteger.cpp)|Easy| |12|[Integer to Roman] [C] ./algorithms/cpp/integerToRoman/integerToRoman.cpp)|Medium| |11|[Container With Most Water] [C] ./algorithms/cpp/containerWithMostWater/containerWithMostWater.cpp), [Java] ./algorithms/java/src/containerwithmostwater.java)|Medium| |10|[Regular Expression Matching] [C] ./algorithms/cpp/regularExpressionMatching/regularExpressionMatching.cpp)|Hard| |9|[Palindrome Number] [C] ./algorithms/cpp/palindromeNumber/palindromeNumber.cpp), [Java] ./algorithms/java/src/palindromeNumber/PalindromeNumber.java)|Easy| |8|[String to Integer (atoi)] [C] ./algorithms/cpp/stringToIntegerAtoi/stringToIntegerAtoi.cpp)|Easy| |7|[Reverse Integer] [C] ./algorithms/cpp/reverseInteger/reverseInteger.cpp)|Easy| |6|[ZigZag Conversion] [C] ./algorithms/cpp/zigZagConversion/zigZagConversion.cpp)|Easy| |5|[Longest Palindromic Substring] [C] ./algorithms/cpp/longestPalindromicSubstring/longestPalindromicSubstring.cpp)|Medium| |4|[Median of Two Sorted Arrays] [C] ./algorithms/cpp/medianOfTwoSortedArrays/medianOfTwoSortedArrays.cpp)|Hard| |3|[Longest Substring Without Repeating Characters] [C] ./algorithms/cpp/longestSubstringWithoutRepeatingCharacters/longestSubstringWithoutRepeatingCharacters.cpp)|Medium| |2|[Add Two Numbers] [C] ./algorithms/cpp/addTwoNumbers/addTwoNumbers.cpp)|Medium| |1|[Two Sum] [C++] ./algorithms/cpp/twoSum/twoSum.cpp), [Go] ./algorithms/golang/twoSum/twoSum.go)|Easy|. l # LeetCode Shell. | # | Title | Solution | Difficulty | |---| ----- | -------- | ---------- | |4|[Tenth Line] [Bash] ./shell/TenthLine.sh)|Easy| |3|[Transpose File] [Bash] ./shell/TransposeFile.sh)|Medium| |2|[Valid Phone Numbers] [Bash] ./shell/ValidPhoneNumbers.sh)|Easy| |1|[Word Frequency] [Bash] ./shell/WordFrequency.sh)|Medium|.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              leetcode has a medium active ecosystem.
              It has 16993 star(s) with 4874 fork(s). There are 1002 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 22 open issues and 36 have been closed. On average issues are closed in 93 days. There are 19 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of leetcode is current.

            kandi-Quality Quality

              leetcode has 0 bugs and 0 code smells.

            kandi-Security Security

              leetcode has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              leetcode code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              leetcode does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              leetcode releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of leetcode
            Get all kandi verified functions for this library.

            leetcode Key Features

            No Key Features are available at this moment for leetcode.

            leetcode Examples and Code Snippets

            No Code Snippets are available at this moment for leetcode.

            Community Discussions

            QUESTION

            Using while let with two variables simultaneously
            Asked 2022-Apr-10 at 08:55

            I'm learning Rust and have been going through leetcode problems. One of them includes merging two linked lists, whose nodes are optional. I want to write a while loop that would go on until at least 1 node becomes None, and I was trying to use the while let loop for that.

            However, it looks like the while let syntax supports only one optional, e.g.:

            ...

            ANSWER

            Answered 2022-Apr-10 at 08:22

            QUESTION

            F2 rename variable doesn't work in vscode + jupyter notebook + python
            Asked 2022-Mar-23 at 04:56

            I can use the normal F2 rename variable functionality in regular python files in vscode. But not when editing python in a jupyter notebook.

            When I press F2 on a variable in a jupyter notebook in vscode I get the familiar change variable window but when I press enter the variable is not changed and I get this error message:

            No result. No result.

            Is there a way to get the F2 change variable functionality to work in jupyter notebooks?

            Here's my system info:

            jupyter module version

            ...

            ANSWER

            Answered 2022-Jan-17 at 02:49

            Notice that you put up a bug report in GitHub and see this issue: Renaming variables didn't work, the programmer replied:

            Some language features are currently not supported in notebooks, but we are making plans now to hopefully bring more of those online soon.

            So please wait for this feature.

            Source https://stackoverflow.com/questions/70729502

            QUESTION

            Is this Union Find really O(n) as they claim?
            Asked 2022-Mar-14 at 07:33

            I am solving a problem on LeetCode:

            Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. So for nums = [100,4,200,1,3,2], the output is 4.

            The Union Find solution to solve this is as below:

            ...

            ANSWER

            Answered 2022-Mar-14 at 07:33

            They are right. A properly implemented Union Find with path compression and union by rank has linear run time complexity as a whole, while any individual operation has an amortized constant run time complexity. The exact complexity of m operations of any type is O(m * alpha(n)) where alpha is the inverse Ackerman function. For any possible n in the physical world, the inverse Ackerman function doesn't exceed 4. Thus, we can state that individual operations are constant and algorithm as a whole linear.

            The key part for path compression in your code is here:

            Source https://stackoverflow.com/questions/71453109

            QUESTION

            Are java streams able to lazilly reduce from map/filter conditions?
            Asked 2022-Jan-12 at 09:30

            I am using a functional programming style to solve the Leetcode easy question, Count the Number of Consistent Strings. The premise of this question is simple: count the amount of values for which the predicate of "all values are in another set" holds.

            I have two approaches, one which I am fairly certain behaves as I want it to, and the other which I am less sure about. Both produce the correct output, but ideally they would stop evaluating other elements after the output is in a final state.

            ...

            ANSWER

            Answered 2022-Jan-12 at 09:30

            The actual term you’re asking for is short-circuiting

            Further, some operations are deemed short-circuiting operations. An intermediate operation is short-circuiting if, when presented with infinite input, it may produce a finite stream as a result. A terminal operation is short-circuiting if, when presented with infinite input, it may terminate in finite time. Having a short-circuiting operation in the pipeline is a necessary, but not sufficient, condition for the processing of an infinite stream to terminate normally in finite time.

            The term “lazy” only applies to intermediate operations and means that they only perform work when being requested by the terminal operation. This is always the case, so when you don’t chain a terminal operation, no intermediate operation will ever process any element.

            Finding out whether a terminal operation is short-circuiting, is rather easy. Go to the Stream API documentation and check whether the particular terminal operation’s documentation contains the sentence

            This is a short-circuiting terminal operation.

            allMatch has it, reduce has not.

            This does not mean that such optimizations based on logic or algebra are impossible. But the responsibility lies at the JVM’s optimizer which might do the same for loops. However, this requires inlining of all involved methods to be sure that this conditions always applies and there are no side effect which must be retained. This behavioral compatibility implies that even if the processing gets optimized away, a peek(System.out::println) would keep printing all elements as if they were processed. In practice, you should not expect such optimizations, as the Stream implementation code is too complex for the optimizer.

            Source https://stackoverflow.com/questions/70673795

            QUESTION

            How are javascript variables referenced?
            Asked 2021-Dec-19 at 00:30

            I'm currently studying for a technical interview and I'm just going through the leetcode grind. I came across a question that is apparently asked pretty frequently by the company I'm about to interview at so I attempted it. I couldn't quite get it so I looked to the solution and came across this solution.

            ...

            ANSWER

            Answered 2021-Dec-19 at 00:30

            This happens because prev's reference is being pointed by res when you do res=[prev], basically the address where the actual prev array is stored is pointed, as the prev updates, it also show changes in res.

            Source https://stackoverflow.com/questions/70408122

            QUESTION

            Will std::sort always compare equal values?
            Asked 2021-Dec-18 at 21:29

            I am doing the following problem on leetcode: https://leetcode.com/problems/contains-duplicate/

            Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

            The solution I came up to the problem is the following:

            ...

            ANSWER

            Answered 2021-Dec-18 at 21:29

            Will std::sort always compare equal values or sometimes it can skip comparing them and therefore duplicate values will not be found?

            Yes, some equal value elements will always be compared if duplicates do exist.

            Let us assume the opposite: initial array of elements {e} for sorting contains a subset of elements having the same value and a valid sorting algorithm does not call comparison operator < for any pair of the elements from the subset.

            Then we construct same sized array of tuples {e,k}, with the first tuple value from the initial array and arbitrary selected second tuple value k, and apply the same sorting algorithm using the lexicographic comparison operator for the tuples. The order of tuples after sorting can deviate from the order of sorted elements {e} only for same value elements, where in the case of array of tuples it will depend on second tuple value k.

            Since we assumed that the sorting algorithm does not compare any pair of same value elements, then it will not compare the tuples with the same first tuple value, so the algorithm will be unable to sort them properly. This contradicts our assumptions and proves that some equal value elements (if they exist in the array) will always be compared during sorting.

            Source https://stackoverflow.com/questions/70136586

            QUESTION

            How can I label connected components in APL?
            Asked 2021-Dec-16 at 12:26

            I'm trying to do leet puzzle https://leetcode.com/problems/max-area-of-island/, requiring labelling connected (by sides, not corners) components.

            How can I transform something like

            ...

            ANSWER

            Answered 2021-Dec-16 at 12:26

            We can start off by enumerating the ones. We do the by applying the function (where, but since all are 1s, it is equivalent to 1,2,3,…) @ at the subset masked by the bits themselves, i.e. ⍸@⊢:

            Source https://stackoverflow.com/questions/70348704

            QUESTION

            Understanding left hand notation of C(n,2)= n(n−1)​ / 2
            Asked 2021-Dec-13 at 16:22

            For an array of n integers, there are C(n,2)= n(n−1)​ / 2 pairs of integers. Thus, we may check all n(n−1)​ / 2 pairs and see if there is any pair with duplicates.

            I was poking around a LeetCode question and the answer for one of the algorithms included the above formula in the question explanation.

            What is the point of the C(n, 2) nomenclature on the left hand side of the equation? Is this a known/named standard that I can read and interpret, or is this some more general information that must/should be ascertained from context? I understand the math on the right, but I don't have any preconceived notions that adds any detail to my understanding from the function on the left.

            What is the 2 doing?

            ...

            ANSWER

            Answered 2021-Dec-13 at 06:30

            It's called binomial coefficient, or "nCk" or "n Choose k".

            The formula is

            Here n is the size of the set, and k = 2 is the number of elements to select, so that e.g. sets {3, 6} and {6,3} taken are considered equal.

            AFAIK, the standard notation in combinatorics is as shown above and spelled "n choose k", where as C(...) is non-standard requiring clarification when first introduced.

            Source https://stackoverflow.com/questions/70329969

            QUESTION

            Longest Common Prefix in Javascript
            Asked 2021-Dec-04 at 10:26

            I am trying to solve the Leet Code challenge 14. Longest Common Prefix:

            Write a function to find the longest common prefix string amongst an array of strings.

            If there is no common prefix, return an empty string "".

            Example 1: ...

            ANSWER

            Answered 2021-Aug-09 at 00:42

            QUESTION

            Binary Search in JS: trying to find a consistent mental model
            Asked 2021-Oct-11 at 13:28

            I am grinding LeetCode these days and I encountered the challenge 162. Find Peak Element:

            A peak element is an element that is strictly greater than its neighbors.

            Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks.

            You may imagine that nums[-1] = nums[n] = -∞.

            You must write an algorithm that runs in O(log n) time.

            Constraints:
            • 1 <= nums.length <= 1000
            • -231 <= nums[i] <= 231 - 1
            • nums[i] != nums[i + 1] for all valid i

            This question is about using binary search to find a peak element in an array.

            I know we can think of the array as alternating ascending and descending sequences. Here is my solution

            ...

            ANSWER

            Answered 2021-Oct-11 at 06:20

            When the following condition is true:

            Source https://stackoverflow.com/questions/69456782

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install leetcode

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/haoel/leetcode.git

          • CLI

            gh repo clone haoel/leetcode

          • sshUrl

            git@github.com:haoel/leetcode.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link