Appendix: Repo Coverage Index
Every file in
src/main/kotlin/— 667 files — mapped to this book.
Legend: → covered by a full page · variant of an alternative/duplicate implementation documented elsewhere · support a helper/non-problem file.
GenerateReadme.kt/ (1 files)
| File | Coverage |
|---|---|
GenerateReadme.kt | support / non-problem |
Main.kt/ (1 files)
| File | Coverage |
|---|---|
Main.kt | support / non-problem |
array/ (115 files)
| File | Coverage |
|---|---|
CheckkIfArrayIsSortedAndRotated.kt | → find minimum in rotated sorted array |
ClosestSubsequenceSum.kt | → closest subsequence sum |
Combinations.kt | → combinations |
NextGreaterElement_III.kt | → next greater element ii |
NextPermutation.kt | → next permutation |
NextPermutationShorter.kt | → next permutation |
PermutationHardFollowup.kt | variant of next permutation |
Permutation_II.kt | → next permutation |
Permutation_II_Backtracking.kt | → next permutation |
Permutation_II_NarayanPandita.kt | variant of next permutation |
Permutations.kt | → permutations |
Subsets.kt | → partition to k equal sum subsets |
Subsets_II.kt | → partition to k equal sum subsets |
practice.kt | support / non-problem |
DiagonalTraverse.kt | → diagonal traverse |
DiagonalTraverse_II.kt | → diagonal traverse |
InsertInterval.kt | → insert interval |
MergeIntervals.kt | → merge intervals |
MergeSortedArray.kt | → merge sorted array |
MissingRanges.kt | → first missing positive |
MoveZeroes.kt | → move zeroes |
RemoveElement.kt | → find peak element |
RotateImage.kt | → rotate image |
SearchA2dMatrix_II.kt | → search a 2d matrix |
SetMatrixZeroes.kt | → set matrix zeroes |
ShortestPathInBinaryMatrix.kt | support / non-problem |
SignOfTheProductOfAnArray.kt | → product of array except self |
SpiralMatrix.kt | → spiral matrix |
SpiralMatrix_II.kt | → spiral matrix |
ToeplitzMatrix.kt | → search a 2d matrix |
TransposeMatrix.kt | → search a 2d matrix |
CombinationSum.kt | → combination sum |
CombinationSum3.kt | → combination sum |
CombinationSum_II.kt | → combination sum |
NQueen.kt | → n-queens |
FindTheDuplicateNumber.kt | → find the duplicate number |
NestedListWeightedSum.kt | → flatten nested list iterator |
BurstBallonsClean.kt | variant of minimum number of arrows to burst balloons |
BurstBaloons.kt | → minimum number of arrows to burst balloons |
CoinChange.kt | → coin change |
CoinChangeBFS.kt | → coin change |
CoinChangeBottomUp.kt | → coin change |
CoinChange_II.kt | → coin change |
CoinChange_II_BottomUp.kt | → coin change |
HouseRobber.kt | → house robber |
HouseRobber_II.kt | → house robber |
KadensAlgorithm.kt | → maximum subarray (Kadane’s algorithm) |
LongestCommonSubarray.kt | → longest common prefix |
LongestIncreasingSequenceInAMatrix.kt | → longest consecutive sequence |
LongestIncreasingSubsequence.kt | → longest increasing subsequence |
MaximalSquare.kt | → maximal square |
MaximumSumOfNonAdjacentElements.kt | variant of binary tree maximum path sum |
MaximumSumSubArray.kt | → binary tree maximum path sum |
MinCostClimbingStaris.kt | → min cost to connect all points |
MinimumNumberofIncrementsSubarraysFormaTargetArray.kt | variant of find minimum in rotated sorted array |
MinimumPathSum.kt | → binary tree maximum path sum |
PartitionArrayIntoTwoArrayToMinimuzeSumDifference.kt | variant of partition equal subset sum |
SplitArrayLargestSum.kt | variant of binary tree maximum path sum |
StoneGame.kt | → jump game |
TargetSum.kt | → binary tree maximum path sum |
CanPlaceFlowers.kt | → can place flowers |
ContainerWithMostWater.kt | → container with most water |
IncreasingTripletSequence.kt | variant of longest consecutive sequence |
KItemsWithMaximumSum.kt | → binary tree maximum path sum |
MInimumNumberOfArrowsRequiredToBurstBallons.kt | → minimum number of arrows to burst balloons |
MaximumDistanceInArray.kt | variant of binary tree maximum path sum |
MaximumSwap.kt | → binary tree maximum path sum |
MergeOverlappingIntervals.kt | → merge intervals |
MinimumNumberOfTapsToWaterGarden.kt | variant of minimum number of arrows to burst balloons |
MinimumNumberofSwapstoMaketheStringBalanced.kt | → minimum number of swaps to make the string balanced |
NonOverlappingIntervals.kt | → non-overlapping intervals |
ContainsDuplicate_II.kt | → contains duplicate ii |
DegreeOfAnArray.kt | → find minimum in rotated sorted array |
DivideArrayIntoEqualPairs.kt | variant of find minimum in rotated sorted array |
EqualRowAndColumnPairs.kt | → equal row and column pairs |
FindDifferenceOfTwoArrays.kt | → median of two sorted arrays |
FindMissingPositive.kt | → first missing positive |
FirstMissingPositive.kt | → first missing positive |
IntegerToEnglishWords.kt | variant of count words with a given prefix |
LongestConsecutiveSequence.kt | → longest consecutive sequence |
MaxNUmWithKSumPairs.kt | variant of max consecutive ones iii |
NumberOfGoodPairs.kt | variant of find the duplicate number |
RankTransformOfAnArray.kt | variant of find minimum in rotated sorted array |
SetMismatch.kt | → set matrix zeroes |
SnapshotArray.kt | → find minimum in rotated sorted array |
UniqueNumberOfOccurences.kt | variant of find the duplicate number |
ValidSudoku.kt | → valid sudoku |
2DPrefixSumImmutable.kt | variant of binary tree maximum path sum |
ContiguousArray.kt | → find minimum in rotated sorted array |
ContinuousSubarraySum.kt | → minimum size subarray sum |
FIndTheHighestAltitute.kt | variant of find first and last position of target |
FindPivotIndex.kt | → find the index of the first occurrence (kmp) |
Minimum NumberofOperationstoMoveAllBallstoEachBox.kt | → minimum operations to move all balls |
NumberOfZeroFilledSubArrays.kt | → number of zero-filled subarrays |
ProductOfArrayExceptSelf.kt | → product of array except self |
SubArrayProductLessThanK.kt | → product of array except self |
SubArraySumEqualsToK.kt | → subarray sum equals k |
SubArraySumsDivisibleByK.kt | → subarray sums divisible by k |
ZeroArrayTransformation_I.kt | variant of find minimum in rotated sorted array |
RandomPickIndex.kt | → random pick with weight |
MeetingScheduler.kt | → meeting rooms |
SortColors.kt | → sort colors |
SquaresOfASortedArray.kt | variant of find minimum in rotated sorted array |
MaximumPopulationYear.kt | variant of binary tree maximum path sum |
4Sum.kt | → binary tree maximum path sum |
IntervalListIntersection.kt | variant of flatten nested list iterator |
LongestMountainInArray.kt | → peak index in a mountain array |
NumberOfArithmaticTriplet.kt | variant of find the duplicate number |
RemoveDuplicateElementsFromSortedArray.kt | variant of contains duplicate ii |
RemoveDuplicateElementsFromSortedArray_II.kt | variant of contains duplicate ii |
RotateArray.kt | → find minimum in rotated sorted array |
ThreeSum.kt | → three sum |
ThreeSumClosest.kt | → closest subsequence sum |
TrappingRainWater.kt | → trapping rain water |
TwoSum_II.kt | → two sum |
autopilot/ (1 files)
| File | Coverage |
|---|---|
H1bAutoPilotStressAnxietyAlgorithm.kt | support / non-problem |
backtracking/ (12 files)
| File | Coverage |
|---|---|
ExpressionAndAddOperators.kt | variant of add two numbers |
ExpressionAndAddOperatorsOptimized.kt | variant of add two numbers |
NQueen.kt | → n-queens |
NQueenOptimized.kt | variant of n-queens (optimized) |
NQueen_II.kt | → n-queens ii |
PalindromePartitioning.kt | → palindrome partitioning |
PartitionToKEqualSumSubsets.kt | → partition to k equal sum subsets |
PathWithMaximumGold.kt | → binary tree maximum path sum |
RestoreIPAddresses.kt | → restore ip addresses |
Strobogrammatic_Number_II.kt | → find the duplicate number |
SudokuSolver.kt | → sudoku solver |
SudokuSolverSet.kt | → sudoku solver |
binarysearch/ (22 files)
| File | Coverage |
|---|---|
ApartmentHunting.kt | → apartment hunting |
CapacityToShipPackageWithinDDays.kt | → capacity to ship packages within d days |
ClosestSebsequenceSum.kt | → closest subsequence sum |
FindFirstAndLastPosition.kt | → find first and last position of target |
FindKClosestElements.kt | → find k closest elements |
FindMinimumInRotatedSortedArray.kt | → find minimum in rotated sorted array |
FindPeakElement.kt | → find peak element |
FindPeakElementBetterSolution.kt | → find peak element |
FirstBadVersion.kt | → first bad version |
GuessNumberHigherOrLower.kt | → guess number higher or lower |
HouseRobber_IV.kt | → house robber |
KThMissingPositiveNumber.kt | → kth missing positive number |
KokoEatingBanana.kt | → koko eating bananas |
MedianOfTwoSortedARrays.kt | → median of two sorted arrays |
PeakIndexInMountainArray.kt | → peak index in a mountain array |
RandomPickWithWeight.kt | → random pick with weight |
SearchA2dMatrix.kt | → search a 2d matrix |
SearchInRotatedArray_II.kt | → search in rotated sorted array |
SearchInRotatedSortedArray.kt | → search in rotated sorted array |
SearchInsertionPosition.kt | → search insert position |
SingleElementInASortedArray.kt | → single element in a sorted array |
ValleyElement.kt | → valley element |
bitset/ (10 files)
| File | Coverage |
|---|---|
FirstLetterToAppearTwice.kt | variant of find first and last position of target |
LongestNiceSubarray.kt | variant of longest common prefix |
MaximumXorOfTwoNumsInArray.kt | → maximum xor of two numbers |
Number of Steps to ReduceaANumberInBinaryRepresentationtoOne.kt | → number of steps to reduce a number in binary |
NumberOfOneBits.kt | → number of 1 bits |
ReverseBits.kt | → reverse bits |
SingleNumber.kt | → single number |
SingleNumber3.kt | → single element in a sorted array |
SmallestNumberWithAllSetBits.kt | → smallest number with all set bits |
SumOfAllSubsetXorTotal.kt | → sum of all subset xor totals |
cache/ (11 files)
| File | Coverage |
|---|---|
LFUCache.kt | → lfu cache |
LFUCacheGigaCHAD.kt | variant of lfu cache |
LRUCache.kt | → lru cache |
LRUCacheBetter.kt | variant of lru cache |
LRUCacheLinkedList.kt | → linked list cycle |
LRUCleanAf.kt | variant of lru cache |
LfuCacheNobodyDoesItBetter.kt | variant of lfu cache |
LruCacheBruceLee.kt | → lru cache |
LruCacheFuckYeah.kt | → lru cache |
LruCacheNobodyDoesItBetter.kt | variant of lru cache |
ThreadSafeLruCache.kt | → thread-safe sharded lru |
commons/ (3 files)
| File | Coverage |
|---|---|
APIEndPoints.kt | support / non-problem |
AlpacaWebSocketFactory.kt | support / non-problem |
FileWriter.kt | support / non-problem |
design/ (2 files)
| File | Coverage |
|---|---|
PeekingIterator.kt | → peeking iterator |
SelfDoubtSimulation.kt | support / non-problem |
disjointset/ (7 files)
| File | Coverage |
|---|---|
AccountMerge.kt | → merge intervals |
DynamicConnectivity.kt | → dynamic connectivity |
NumberOfIsland_II.kt | → find the duplicate number |
NumerOfIsland_II_Optimized.kt | → max area of island |
PowerGridMaintainance.kt | support / non-problem |
TheEarliestMomentEveryoneBecameFriends.kt | → the earliest moment everyone became friends |
UnionFind.kt | → find first and last position of target |
dynamic_programming/ (12 files)
| File | Coverage |
|---|---|
01Knapsack.kt | → 0/1 knapsack |
ClosestSubsequenceSum.kt | → closest subsequence sum |
FrogJump.kt | → frog jump |
FrogJumpTopDown.kt | → frog jump |
MaximumProductSubarray.kt | → maximum product subarray |
MaximumProfitInJobScheduling.kt | → maximum profit in job scheduling |
MinimumCostToCutAStick.kt | → minimum cost to cut a stick |
MinimumCostToMergeStones.kt | → minimum cost to merge stones |
MinimumCostToMergeStones_Intuition.kt | → minimum cost to merge stones |
PartitionEqualSubsetSum.kt | → partition equal subset sum |
SuperEggDropping.kt | → super egg drop |
UnboundedKnapsack.kt | → unbounded knapsack |
facebook/ (2 files)
| File | Coverage |
|---|---|
FindMinimumTicketPrice.kt | → find minimum in rotated sorted array |
SecondGreatestNumber.kt | support / non-problem |
geo/ (4 files)
| File | Coverage |
|---|---|
KDTreeExample.kt | → kd-tree |
ConstructQuadTree.kt | → construct tree from preorder and inorder |
QuadTree.kt | → binary tree inorder traversal (iterative) |
QuadTreeUsagePlaceFinding.kt | support / non-problem |
google/ (14 files)
| File | Coverage |
|---|---|
CountNumberOfWaysToPickKCoinsSumDivisibleByM.kt | → count ways to pick k coins divisible by m |
CourseWithSemesterConstraint.kt | variant of course schedule ii |
GoogleCheatSeetDeepSeekDeekThinkEdition.kt | support / non-problem |
GoogleCheatSheat.kt | support / non-problem |
GoogleCheatSheet_II.kt | support / non-problem |
GoogleCheatSheet_III.kt | support / non-problem |
GoogleCheatSheet_IV.kt | support / non-problem |
GooglrCheatSheetGraphEdition.kt | support / non-problem |
HandsOnCollectionsPLayground.kt | support / non-problem |
LargestSquareAreaInMatrix.kt | variant of kth largest element |
MInDifferenceBetweenTotalSums.kt | variant of min cost to connect all points |
MinimumTimeToFinishBuildByKWorkers.kt | → minimum time to collect all apples |
ShuffleWithRandomness.kt | → shuffle an array |
SongShuffle.kt | → shuffle an array |
graph/ (77 files)
| File | Coverage |
|---|---|
BusRoutes.kt | → reorder routes to city zero |
CalculateGraphDiameter.kt | variant of clone graph |
ChromaticNumber.kt | → find the duplicate number |
ChromaticNumberOptimized.kt | variant of find the duplicate number |
CloneGraph.kt | → clone graph |
CourseSchedule_II_Idiomatic.kt | → course schedule ii |
DiameterOfBinaryTree.kt | → diameter of binary tree |
EvalualteDivisions.kt | → evaluate division |
HouseRobber3.kt | → house robber |
IsBipartileBFSFunctional.kt | variant of is graph bipartite (BFS functional version) |
IsBipartileGraph.kt | → clone graph |
IsBipartileGraphDfs.kt | variant of clone graph |
LargeScaleCourseSchedule.kt | → course schedule ii |
MaximumPathQualityOfAGraph.kt | → binary tree maximum path sum |
MinimumGeneticMutations.kt | variant of find minimum in rotated sorted array |
NColoringGraph.kt | → clone graph |
NColoringGreedy.kt | → n-coloring greedy |
ParallelCourses_II_FunctionalProgramming.kt | support / non-problem |
ReorderRoutesToMakeAllPathsLeadToCityZero.kt | support / non-problem |
WordLadder.kt | → word ladder |
WordLadder_II.kt | → word ladder |
WordLadder_II_FinalCutPro.kt | variant of word ladder |
WordLadder_II_clean.kt | → word ladder |
CriticalConnectionsInANetwork.kt | → critical connections in a network |
CriticalConnectionsInANetworkShortCode.kt | variant of critical connections in a network |
FindArticulationPoints.kt | variant of count rectangles formed by points |
BinarySearchTreeToGreaterSumTree.kt | → binary tree maximum path sum |
RangeSumOfBST.kt | variant of binary tree maximum path sum |
FindConnectedComponents.kt | → strongly connected components |
BFSCycleDetection.kt | variant of course schedule ii (Kahn’s BFS cycle detection) |
CourseSchedule.kt | → course schedule ii |
CourseSchedule_II.kt | → course schedule ii |
FindLengthOfLongestCycle.kt | variant of find first and last position of target |
ParallelCourses.kt | support / non-problem |
BellmanFordAlgorithm.kt | → bellman-ford |
CheapestFlightsWithinKStops.kt | → cheapest flights with k stops |
CheapestFlightsWithinKStopsBellman.kt | → cheapest flights with k stops |
FloydWarshallAlgorithm.kt | → floyd-warshall |
MaximumVacationDays.kt | variant of binary tree maximum path sum |
ParallelCourses_II.kt | support / non-problem |
ParallelCourses_II_Recursive.kt | support / non-problem |
SocialNetworkOperations.kt | variant of critical connections in a network |
CrackingTheSafe.kt | → find peak element (safe boundaries) |
FindEulerianCircuit.kt | variant of find first and last position of target |
Theory.kt | support / non-problem |
ReconstructItenary.kt | → reconstruct itinerary |
ValidArrangementOfPairs.kt | variant of longest valid parentheses |
ValidArrangementOfPairsRecursive.kt | variant of longest valid parentheses |
BipartileMatching.kt | → maximum bipartite matching |
EdmondsKarp.kt | → max flow (edmonds-karp) |
EdmondsKarpAdjacencyList.kt | → max flow (edmonds-karp) |
EdmondsKarpAnother.kt | → max flow (edmonds-karp) |
EdmondsKarpImpovised.kt | → max flow (edmonds-karp) |
MaxFlowEdmondsKarp.kt | → max flow (edmonds-karp) |
MaximumBipartileJobMatching.kt | → maximum bipartite matching |
CheapestFlightWithKStops.kt | variant of cheapest flights with k stops |
CheapestFlightsWithKStops.kt | → cheapest flights with k stops |
DonaldTrumpAlgorithm.kt | support / non-problem |
NetworkDelayTime.kt | → network delay time |
TheMaze_III.kt | → max consecutive ones iii |
FindRedundentConnections.kt | variant of critical connections in a network |
OptimizeWaterDistributionInAVillage.kt | variant of container with most water |
PrimsAlgorithm.kt | → min cost to connect all points (prim’s) |
PrimsShorter.kt | → min cost to connect all points (prim’s) |
Kosaraju.kt | variant of strongly connected components (Kosaraju’s algorithm) |
Tarjans.kt | variant of strongly connected components (Tarjan’s algorithm) |
AlienDictionary.kt | → alien dictionary |
AlienDictionary_BFS.kt | → alien dictionary |
ApplySubstitutions.kt | → apply substitutions |
CourseSchedule_II.kt | → course schedule ii |
CourseSchedule_II_BFS.kt | → course schedule ii |
ProteinFolding.kt | support / non-problem |
ShortestPathVisitingAllNodes.kt | support / non-problem |
TSPHelpKarp.kt | → find the index of the first occurrence (rabin-karp) |
TravellingSalesPersonTopDownDP.kt | variant of travelling salesman (held-karp) (top-down DP) |
TravellingSalesmanRecursiveDP.kt | → travelling salesman (held-karp) |
TravellingSalespersonProblemBruteforceMatrix.kt | variant of travelling salesman (held-karp) (brute force) |
greedy/ (17 files)
| File | Coverage |
|---|---|
CarFleet.kt | → car fleet |
DestroyingAsteroids.kt | → destroying asteroids |
JumpGame.kt | → jump game |
JumpGame_II.kt | → jump game |
MInimumCostHomecomingOfARobot.kt | → minimum cost to cut a stick |
MaxChuncksToMakeSorted_II.kt | variant of max consecutive ones iii |
MaxProfiAssigningWork.kt | variant of max consecutive ones iii |
MaximumValueOfAnOrderedTriplet_II.kt | variant of binary tree maximum path sum |
MeetingRooms.kt | → meeting rooms |
MeetingRooms_II.kt | → meeting rooms |
MeetingRooms_II_greedy.kt | → meeting rooms |
MinimumDeletionsToMakeStringBalanced.kt | → minimum deletions to make string balanced |
MinimumNumberOfRefuelingStops.kt | → minimum number of refueling stops |
MinimumReplacementToSortTheArray.kt | → find minimum in rotated sorted array |
MinimumTimeToMakeRopeColorful.kt | → minimum time to make rope colorful |
RescheduleMeetingsforMaximumFreeTime_I.kt | → reschedule meetings for maximum free time |
TaskScheduler.kt | → task scheduler |
grid/ (22 files)
| File | Coverage |
|---|---|
FloodFill.kt | → flood fill |
IslandPerimeter.kt | → island perimeter |
MakingALargeIsland.kt | → making a large island |
MakingALargeIsland_AnotherApproach.kt | → making a large island |
MaxAreaOfIsland.kt | variant of max consecutive ones iii |
MaximumNumberOfFishInAGrid.kt | variant of binary tree maximum path sum |
PacificAtlanticWaterFlow.kt | variant of container with most water |
RottingOranges.kt | → rotting oranges |
ShortestBridge.kt | support / non-problem |
ShortestDistanceFromAllBuildings.kt | support / non-problem |
SurroundedRegion.kt | → surrounded regions |
SurroundedRegionDfs.kt | variant of pattern primer: dfs with an undo button |
TrappingRainwater_II.kt | → trapping rain water |
WallsAndGates.kt | → walls and gates |
ShortestPathInGridWithObstaclesElimination.kt | support / non-problem |
CherryPickup.kt | → cherry pickup |
CherryPickup_II.kt | → cherry pickup |
Test.kt | support / non-problem |
UniquePaths_I.kt | → first unique character |
UniquePaths_II.kt | → first unique character |
MaximalRectangle.kt | → largest rectangle in histogram |
WordSearch_II.kt | → design add and search words |
hashtable/ (12 files)
| File | Coverage |
|---|---|
CountNumberOfBadPairs.kt | variant of count rectangles formed by points |
DesignANumberContainerSystem.kt | → design auto complete system |
DesignFileSystem.kt | → design auto complete system |
DesignHashMap.kt | variant of design a stack with increment operations |
FirstUniqueCharacter.kt | → first unique character |
HIndex.kt | → h-index |
IntegerToRoman.kt | → roman to integer |
IntersectionOfTwoArray.kt | → pattern primer: two pointers & the sorted-array dance |
MaximumFrequencyStack.kt | variant of binary tree maximum path sum |
RomanToInteger.kt | → roman to integer |
WorkBreak_II.kt | → word break |
WorlBreak_I_DP.kt | → word break |
heap/ (12 files)
| File | Coverage |
|---|---|
DualBalancedHeap.kt | variant of find median from data stream (dual-heap structure) |
FindKClosestElements.kt | → find k closest elements |
FindScoreOfAnArrayAfterMarkingAllElements.kt | variant of find k closest elements |
FindingMKAverage.kt | → finding mk average |
IPO.kt | → ipo (maximize capital) |
LongestHappyString.kt | variant of decode string |
MedianFromRunningStream.kt | → find median from data stream |
MeetingRoom_III.kt | → meeting rooms iii |
SingleThreadedCPU.kt | → single threaded cpu |
SlidingWindowMedian.kt | → sliding window median |
TopKFrequentElements.kt | → top k frequent elements |
TrappingRainWater_II.kt | → trapping rain water |
linkedlist/ (23 files)
| File | Coverage |
|---|---|
AddTwoNumbers.kt | → add two numbers |
CopyLinkedListWithRandomPointer.kt | variant of linked list cycle |
DeleteMiddleNodeOfLinkedList.kt | variant of linked list cycle |
InsertIntoASortedCircularLinkedList.kt | variant of linked list cycle |
InsertIntoASortedCircularList.kt | variant of flatten nested list iterator |
IntersectionOfTwoLinkedList.kt | → linked list cycle |
LinkedListCycle.kt | → linked list cycle |
LinkedListCycle_II.kt | → linked list cycle |
MaximumTwinSumOfALinkedList.kt | variant of binary tree maximum path sum |
MergeKSortedList.kt | → merge k sorted lists (divide & conquer, top-down) |
MergeKSortedListHeap.kt | → merge k sorted lists (heap merge) |
MergeKSortedListIterative.kt | → merge k sorted lists (divide & conquer, bottom-up) |
MergeTwoSortedLIst.kt | → merge two sorted lists |
MiddleNode.kt | → remove nth node from end |
OddEvenLinkedList.kt | → linked list cycle |
OddOrEvenLinkedList.kt | → linked list cycle |
PalindromeLinkedList.kt | → linked list cycle |
RemoveNthNodeFromEndOfList.kt | → remove nth node from end |
ReverseLinkedList.kt | → reverse linked list |
ReverseLinkedListIterative.kt | → reverse linked list |
ReverseNodesInKGroups.kt | variant of evaluate reverse polish notation |
RotateList.kt | → flatten nested list iterator |
SwapNodesInPairs.kt | variant of shortest path visiting all nodes |
math/ (36 files)
| File | Coverage |
|---|---|
AddStrings.kt | → add two numbers |
DesignTicTacToe.kt | variant of design a stack with increment operations |
DetectSquares.kt | → word squares |
DivideTwoIntegers.kt | variant of add two numbers |
HappyNumber.kt | → find the duplicate number |
MinimumMovesToEqualArrayElements.kt | → find minimum in rotated sorted array |
MultiplyStrings.kt | → isomorphic strings |
PlusOne.kt | → plus one |
PowerOfTwo.kt | support / non-problem |
ReverseInteger.kt | → evaluate reverse polish notation |
SlidingPuzzle.kt | → sliding window maximum |
Sqrt.kt | variant of sqrt(x) |
StringtoIntegerAtoi.kt | variant of roman to integer |
AddBinary.kt | → add two numbers |
PascalsTriangle.kt | → pascal’s triangle |
CheckIfTwoLinesIntrsects.kt | variant of add two numbers |
ConvexHull.kt | → convex hull (erect the fence) |
CountNumberOfTrapizoids_I.kt | variant of count rectangles formed by points |
ErectTheFence_ConvexHull.kt | → convex hull (erect the fence) |
HowManyRectanglesOverlapSweepLine.kt | → how many rectangles overlap |
HowManyRectanglesOverlaping.kt | variant of count rectangles formed by points |
MaxPointsOnALine.kt | variant of count rectangles formed by points |
RectangleArea.kt | → largest rectangle in histogram |
RectangleArea_II.kt | → largest rectangle in histogram |
RectangleArea_II_SegmentTree.kt | variant of binary tree inorder traversal (iterative) |
RectangleOverlap.kt | → largest rectangle in histogram |
SeperateSquares_I.kt | → word squares |
FindingNumberOfVisibleMountains.kt | variant of find the duplicate number |
HowManyRectangleOverlapsIntervalTree.kt | → how many rectangles overlap |
RectangeOverlapCountTreeSet.kt | → how many rectangles overlap |
pow.kt | support / non-problem |
BasicCalculator.kt | → basic calculator ii |
BasicCalculator_I.kt | → basic calculator ii |
BasicCalculator_II.kt | → basic calculator ii |
BasicCalculator_III.kt | variant of max consecutive ones iii |
BasicCalculator_II_ShortCode.kt | → basic calculator ii |
microsoft/ (3 files)
| File | Coverage |
|---|---|
Demo.kt | support / non-problem |
Toast.kt | support / non-problem |
ValidTime.kt | support / non-problem |
ml/ (1 files)
| File | Coverage |
|---|---|
DecisionTree.kt | support / non-problem |
numbers/ (1 files)
| File | Coverage |
|---|---|
PalindromeNumber.kt | → find the duplicate number |
probability/ (5 files)
| File | Coverage |
|---|---|
InsertDeleteGetRandom.kt | → insert delete getrandom o(1) |
InsertDeleteGetRandomAtO1.kt | → insert delete getrandom o(1) |
LinkedListRandomNode.kt | → linked list cycle |
PathWithMaximumProbability.kt | → binary tree maximum path sum |
ReservoirSampling.kt | → weighted reservoir sampling |
queueu/ (4 files)
| File | Coverage |
|---|---|
DesignACircularQueue.kt | variant of design a stack with increment operations |
DesignHitCounter.kt | variant of design a stack with increment operations |
NumberOfRecentCalls.kt | variant of find the duplicate number |
ProductOfLastKNumbers.kt | variant of find first and last position of target |
quicksort/ (6 files)
| File | Coverage |
|---|---|
DualPivotQuickSelect.kt | → top k frequent elements (quickselect) |
GenericRanrmoizedQuickSelect.kt | → top k frequent elements (quickselect) |
KClosestPointsToOrigin.kt | → k closest points to origin |
KThLargestElementInArray.kt | → kth largest element |
KthLargestElementInArrayTailRec.kt | → kth largest element |
TopKFrequentElements.kt | → top k frequent elements |
real_word_projects/ (18 files)
| File | Coverage |
|---|---|
HttpApiCall.kt | support / non-problem |
InterfaceExample.kt | support / non-problem |
ParallelFibonacci.kt | support / non-problem |
ScaleTransactions.kt | support / non-problem |
SystemInterviewHack.kt | support / non-problem |
TradingAPICallExample.kt | support / non-problem |
DataModels.kt | support / non-problem |
ChannelsExample.kt | support / non-problem |
SimpleThreadPool.kt | support / non-problem |
ConsistentHashing.kt | support / non-problem |
AiTest.kt | support / non-problem |
DuckworthLewisStern.kt | support / non-problem |
JsonExample.kt | support / non-problem |
CheckIfIPBelongsToNetworkAddress.kt | variant of critical connections in a network |
FindMaxInArray.kt | → find minimum in rotated sorted array |
ParallelMatrixMultiplication.kt | support / non-problem |
AlpacaSDKExamples.kt | support / non-problem |
RealtimeMarketDataStreaming.kt | variant of find median from data stream |
simulation/ (7 files)
| File | Coverage |
|---|---|
CarPooling.kt | → car fleet |
CountCollisionsOnARoad.kt | variant of count rectangles formed by points |
FindWinnerOnATicTacToeGame.kt | → find winner on a tictactoe game |
LatestTimeToCatchBus.kt | support / non-problem |
Racecar.kt | → racecar |
RobotBoundedInCircle.kt | → robot bounded in circle |
TextJustification.kt | → text justification |
sliding_window/ (14 files)
| File | Coverage |
|---|---|
LongestContinuousSubarrayWithAbsoluteDifferenceLessThanOrEqualToLimit.kt | variant of longest common prefix |
LongestRepeatingCharacterReplacement.kt | → longest repeating character replacement |
LongestSubArraysOfOneAfterDeletingOneElement.kt | → longest subarray of 1s after deleting one |
LongestSubstringWithoutRepeatingCharacter.kt | → longest repeating character replacement |
MaxConsecutiveOnes_III.kt | → max consecutive ones iii |
MaximumAverageSubarray_I.kt | → maximum average subarray i |
MaximumErasureValue.kt | variant of binary tree maximum path sum |
MaximumSumOfDistinctSubarraysWithLengthK.kt | variant of binary tree maximum path sum |
MinimumSizeSubarraySum.kt | → minimum size subarray sum |
MinimumSwapsToGroupAllOnesTogether.kt | → minimum operations to move all balls |
MinimumWindowSubstring.kt | → minimum window substring |
PartitionLabels.kt | → partition equal subset sum |
ProgrammerString.kt | → decode string |
SlidingWindowMaximum.kt | → sliding window maximum |
sorting/ (6 files)
| File | Coverage |
|---|---|
EmployeeFreeTime.kt | variant of best time to buy and sell stock ii |
HIndex.kt | → h-index |
LargestNumber.kt | → largest number |
MergeSort.kt | → merge sort |
RankTeamsByVote.kt | → rank teams by votes |
RussianDollEnvelope.kt | → russian doll envelopes |
speed_dating/ (1 files)
| File | Coverage |
|---|---|
ComputerScienceEngineerDating.kt | support / non-problem |
stack/ (27 files)
| File | Coverage |
|---|---|
AestroidCollisions.kt | → asteroid collision |
BuildingsWithAnOceanView.kt | variant of binary tree right side view |
DailyTemperatures.kt | → daily temperatures |
DesignAStackWithIncrementOperations.kt | → design a stack with increment operations |
EvaluateReversePolishNotation.kt | → evaluate reverse polish notation |
ExclusiveTimeOfFunctions.kt | variant of best time to buy and sell stock ii |
FlattenNestedListIterator.kt | → flatten nested list iterator |
LargestRectangleInHistogram.kt | → largest rectangle in histogram |
LongestValidParanthesis.kt | → longest valid parentheses |
MinStack.kt | → min stack |
MinStackShort.kt | → min stack |
MinimumAddtoMakeParenthesesValid.kt | variant of longest valid parentheses |
MinimumDeletionsToMakeStringBalanced.kt | → minimum deletions to make string balanced |
MinimumOperationstoConvertAllElementstoZero.kt | → minimum operations to convert all elements to zero |
MinimumRemoveToMakeValidParentheses.kt | variant of longest valid parentheses |
NextGreaterElement_I.kt | → next greater element ii |
NextGreaterElement_II.kt | → next greater element ii |
NumberOfVisiblePeopleInAQueue.kt | variant of find the duplicate number |
OneThreeTwoPattern.kt | → pattern primer: o(1) lookup, three moves |
OnlineStockSpan.kt | variant of best time to buy and sell stock ii |
RemoveDuplicateLetters.kt | variant of contains duplicate ii |
RemoveKDigits.kt | → remove k digits |
RemoveStarsFromString.kt | variant of decode string |
SmallestSubsequenceOfDistinctCharacters.kt | variant of closest subsequence sum |
SumOfSubArrayMinimum.kt | → find minimum in rotated sorted array |
SumOfSubArrayRanges.kt | variant of binary tree maximum path sum |
ValidParentheses.kt | → longest valid parentheses |
stock_market/ (5 files)
| File | Coverage |
|---|---|
BestTimeToBuyAndSellStock.kt | → best time to buy and sell stock ii |
BestTimeToBuyAndSellStockWithCooldown.kt | → best time to buy and sell stock ii |
BestTimeToBuyAndSellStockWithTransactionFee.kt | → best time to buy and sell stock ii |
BestTimeToBuyAndSellStock_III.kt | → best time to buy and sell stock ii |
BestTimeToBuyAndSellStock_II.kt | → best time to buy and sell stock ii |
stream/ (1 files)
| File | Coverage |
|---|---|
MovingAverageOfARunningStream.kt | variant of find median from data stream |
string/ (69 files)
| File | Coverage |
|---|---|
ApplySubstitutions.kt | → apply substitutions |
CheckifaParenthesesStringCanBeValid.kt | variant of longest valid parentheses |
CountAndSay.kt | → count rectangles formed by points |
CountNumberOfWordsWhichAreSubSequence.kt | variant of count words with a given prefix |
CountWordsWithAGivenPrefix.kt | → count words with a given prefix |
DetectCapital.kt | → ipo (maximize capital) |
ExcelSheetToColumnNumber.kt | variant of find the duplicate number |
FindUniqueBinaryString.kt | variant of binary tree inorder traversal (iterative) |
GoatLatin.kt | → goat latin |
GreatestCommonDivisorOfStrings.kt | support / non-problem |
GroupAnagrams.kt | → group anagrams |
IsSubsequence.kt | → closest subsequence sum |
IsomorphicString.kt | → decode string |
LengthOfLastWord.kt | variant of find first and last position of target |
LongestCommonPrefix.kt | → longest common prefix |
LongestPalidnromicSubstring.kt | → longest common substring |
MaximumLengthofaConcatenatedStringwithUniqueCharacters.kt | → maximum length of concatenated string |
MaximumNumberOfNonOverlappingPalindromicSubstring.kt | variant of longest palindromic substring |
MaximumValueAfterInsertion.kt | variant of binary tree maximum path sum |
MaximumValueOfAStringIsAnArray.kt | variant of binary tree maximum path sum |
MergeStringAlternatively.kt | variant of decode string |
MinimumDeletionToMakeCharacterFrequenciesUnique.kt | variant of first unique character |
ReverseVowelOfString.kt | → reverse words in a string |
ReverseWordsInString.kt | → reverse words in a string |
StringCompression.kt | → decode string |
StringCompression_II.kt | → decode string |
ValidAnagram.kt | → valid anagram |
ValidNumber.kt | → find the duplicate number |
ValidPalindrome.kt | → valid palindrome |
ValidPalindrome_II.kt | → valid palindrome |
ValidWordAbbreviation.kt | variant of longest valid parentheses |
ValidateIPAddress.kt | → validate ip address |
ValidateIPAddressBetterImplementation.kt | variant of validate ip address |
GenerateParantheses.kt | → generate parentheses |
WordBreak_II.kt | → word break |
WordSquare.kt | → maximal square |
DeleteOperationsForTwoStrings.kt | variant of add two numbers |
EditDistance.kt | → minimum edit distance |
InterleavingString.kt | → decode string |
LongestCommonSubsequence.kt | → longest common subsequence |
LongestCommonSubstring.kt | → longest common substring |
LongestPalindromicSubsequence.kt | → longest common subsequence |
LongestPalindromicSubsequence_BottomUp.kt | → longest common subsequence |
LongestStringChain.kt | variant of decode string |
PalindromePartitioning_II.kt | → palindrome partitioning |
RegularExpressionMatching.kt | variant of maximum bipartite matching |
ShortestCommonSuperSequence_Modular.kt | support / non-problem |
ShortestCommonSupersequence.kt | support / non-problem |
ValidPalindrome_III.kt | → valid palindrome |
ValidPalindrome_III_SpaceOptimized.kt | variant of valid palindrome |
BreakAPalindrome.kt | → word break |
ShortestWayToFormAString.kt | support / non-problem |
DetermineIfStringsAreClose.kt | variant of isomorphic strings |
GroupShiftedStrings.kt | variant of group anagrams |
PermutationsInString.kt | → decode string |
UniqueLength3PalindromicSubsequence.kt | variant of closest subsequence sum |
UniqueSubstringWithEqualDigitFrequency.kt | variant of first unique character |
BengaliProgramming.kt | support / non-problem |
FindTheIndexofTheFirstOccurrenceIna String.kt | → find the index of the first occurrence (kmp) |
FindTheIndexofTheFirstOccurrenceIna String_RabinKarp.kt | → find the index of the first occurrence (rabin-karp) |
FindAllAnagrams.kt | variant of find first and last position of target |
MaximumNumberofVowelsinSubstringofGivenLength.kt | → maximum length of concatenated string |
MinimumWindowSubsequence.kt | → minimum window substring |
MinimumWindowSubstring.kt | → minimum window substring |
CustomSortString.kt | variant of decode string |
CustomSortString_Linear.kt | variant of decode string |
DecodeString.kt | → decode string |
RemoveAllAdjacentDuplicatesInString.kt | → remove all adjacent duplicates |
SimplifyPath.kt | → binary tree maximum path sum |
tree/ (71 files)
| File | Coverage |
|---|---|
AllNodesDistanceKinBinaryTree.kt | variant of binary tree inorder traversal (iterative) |
BInaryTreeInOrderTraversalIterative.kt | → binary tree inorder traversal (iterative) |
BalancedBinaryTree.kt | → binary tree inorder traversal (iterative) |
BinaryTreeLevelOrderTraversal.kt | → binary tree level order traversal |
BinaryTreeMaximumPathSum.kt | → binary tree maximum path sum |
BinaryTreeRightSideView.kt | → binary tree right side view |
BinaryTreeVerticalOrderTraversal.kt | → binary tree level order traversal |
BinaryTreeVerticalOrderTraversal_WithoutSorting.kt | → binary tree level order traversal |
BinaryTreeZigZagLevelOrderTraversal.kt | → binary tree level order traversal |
BoundaryOfBinaryTree.kt | → binary tree inorder traversal (iterative) |
ConstructBinaryTreeFromInorderAndPostOrderTraversal.kt | → binary tree inorder traversal (iterative) |
ConstructBinaryTreeFromPreorderAndInOrderTraversal.kt | → binary tree level order traversal |
ConstructBinaryTreeFromString.kt | → binary tree inorder traversal (iterative) |
CountGoodNodeInBInaryTree.kt | variant of binary tree inorder traversal (iterative) |
CountNodeEqualsAverage.kt | variant of count rectangles formed by points |
DiameterOfNArrayTree.kt | → diameter of binary tree |
LeafSimilar.kt | → leaf-similar trees |
LongestPathWithDifferentAdjacentCharacters.kt | variant of longest substring without repeating characters |
LongestUnivaluePath.kt | variant of binary tree maximum path sum |
LowestCommonAncestor.kt | → lowest common ancestor |
LowestCommonAncestor_III.kt | → lowest common ancestor |
MaximumDepthOfBinaryTree.kt | → maximum depth of binary tree |
MaximumLevelSumOfABinaryTreee.kt | variant of binary tree maximum path sum |
MaximumProductOfSplittedBinaryTree.kt | → binary tree maximum path sum |
MaximumSumBSTInBinaryTree.kt | → binary tree maximum path sum |
MaximumWidthOfBinaryTree.kt | → binary tree maximum path sum |
MinimumTimeToCollectAllApplesInATree.kt | → minimum time to collect all apples |
PathSum.kt | → binary tree maximum path sum |
PathSumIII.kt | → path sum iii |
PathSum_II.kt | → binary tree maximum path sum |
PopulateNextRightPointersInEachNode_II.kt | → populating next right pointers in each node |
PopulateNextRightPointersInEachNode_II_Constant.kt | → populating next right pointers in each node |
PopulatingNextRightPointerInEachNode.kt | → populating next right pointers in each node |
RecoverATreeFromPreOrderTraversal.kt | variant of binary tree level order traversal |
SerializeAndDeserializeABinaryTree.kt | → serialize and deserialize binary tree |
SerializeAndDeserializeNArrayTree.kt | → serialize and deserialize binary tree |
SlidingWindowMedianTreeSet.kt | → sliding window median |
StepByStepDirectionsFromANodeToAnother.kt | → step-by-step directions |
SumRootToLeafNumbers.kt | variant of add two numbers |
VerticalOrderTraversalOfABinaryTree.kt | → binary tree level order traversal |
AverageOfLevelsInBinaryTree.kt | → binary tree inorder traversal (iterative) |
BinaryTreeLevelOrderTraversal_II.kt | → binary tree level order traversal |
CheckCompletenessOfBinaryTree.kt | → binary tree inorder traversal (iterative) |
FindLargestValueInEachTreeRow.kt | → find largest value in each tree row |
BSTIterator.kt | → bst iterator |
ClosestBinarySearchTreeValue.kt | variant of binary tree inorder traversal (iterative) |
ConvertBInarySearchTreeToSortedDoublyLinkedList.kt | variant of binary tree inorder traversal (iterative) |
DeleteNodeinABST.kt | variant of insert delete getrandom o(1) |
GetClosestElement.kt | variant of closest subsequence sum |
InorderSuccessor.kt | → binary tree inorder traversal (iterative) |
LongestIncreasingSubsequence.kt | → longest increasing subsequence |
MinimumNumberOfRemovalsToMakeMountainArray.kt | variant of find minimum in rotated sorted array |
MyCalendar.kt | → my calendar |
OrderedStatisticsTree.kt | variant of binary tree inorder traversal (iterative) |
OrderedStatisticsTreeForStreamers.kt | variant of binary tree inorder traversal (iterative) |
RecoverBinarySearchTree.kt | → binary tree inorder traversal (iterative) |
SkylineProblem.kt | → the skyline problem |
StreamerRanking.kt | → streamer leaderboard |
UniqueBinarySearchTrees.kt | → pattern primer: the binary search theorem |
UniqueBinarySearchTrees_II.kt | → pattern primer: the binary search theorem |
CountOfSmallerNumberAfterSelf.kt | variant of count rectangles formed by points |
FenwickTree.kt | support / non-problem |
RangeSumQuery2dMutable.kt | variant of binary tree maximum path sum |
RangeSumQueryMutable.kt | variant of binary tree maximum path sum |
IntervalTree.kt | → binary tree inorder traversal (iterative) |
MinCostToConnectAllPointsKruskal.kt | → min cost to connect all points |
MinCostToConnectAllPointsPrims.kt | → min cost to connect all points (prim’s) |
DynamicSegmentTree.kt | variant of binary tree inorder traversal (iterative) |
IterativeSegmentTree.kt | → binary tree inorder traversal (iterative) |
MyCalendar_II.kt | → my calendar ii |
SegmentTree.kt | → binary tree inorder traversal (iterative) |
trie/ (12 files)
| File | Coverage |
|---|---|
AbstractTrie.kt | → implement trie (prefix tree) |
AutoCompleteSystem.kt | → design auto complete system |
AutoCompleteSystemWithHeap.kt | → design auto complete system |
CountWordsWithAGivenPrefix_Trie.kt | → count words with a given prefix |
CountWordsWithAGivenPrefix_Trie_FP.kt | → count words with a given prefix |
DesignAddAndSearchWordDataStructure.kt | → design add and search words |
EqualRowAndColumnPairs.kt | → equal row and column pairs |
LongestCommonPrefix.kt | → longest common prefix |
SearchSuggestionSystem.kt | → search suggestion system |
WordBreak_I.kt | → word break |
WordSquare.kt | → maximal square |
WordSquaresShorter.kt | → word squares |