Ctrl K

Coding problems

Algorithm problems with tests in Python, JavaScript, Java, Go and C++, checked on our server.

Median Across Two ArraysArray · Binary Search · Divide and ConquerHardMerge Many Sorted ChainsLinked List · Divide and Conquer · Heap (Priority Queue)HardMost Profitable StreakArray · Divide and Conquer · Dynamic ProgrammingMediumTree From Pre-Order and In-Order WalksTree · Array · Hash TableMediumTree From In-Order and Post-Order WalksTree · Array · Hash TableMediumBalanced Tree from a Sorted ListTree · Binary Search Tree · ArrayEasyTree From a Sorted ChainTree · Binary Search Tree · Linked ListMediumSorting a Linked ListLinked List · Two Pointers · Divide and ConquerMediumThe Candidate With Most VotesArray · Hash Table · Divide and ConquerEasyFlip the Bit OrderBit Manipulation · Divide and ConquerEasyCount the Set BitsBit Manipulation · Divide and ConquerEasyK-th Highest ScoreArray · Divide and Conquer · QuickselectMediumCity Block OutlineBinary Indexed Tree · Segment Tree · ArrayHardFind in a Grid Sorted Both WaysArray · Binary Search · Divide and ConquerMediumSmaller Values to the RightBinary Indexed Tree · Segment Tree · ArrayHardStrictly Low, High, LowGreedy · Array · Divide and ConquerMediumWindow Sums Within a BandBinary Indexed Tree · Segment Tree · ArrayHardMost Common ValuesArray · Hash Table · Divide and ConquerMediumEvery Letter at Least k TimesHash Table · String · Divide and ConquerMediumPairs With a Steep DropBinary Indexed Tree · Segment Tree · ArrayHardPeak-Split TreeStack · Tree · ArrayMediumTree From Pre-Order and Post-Order WalksTree · Array · Hash TableMediumHand-Rolled SortArray · Divide and Conquer · Bucket SortMediumBest Run on a RingQueue · Array · Divide and ConquerMediumNo Average in BetweenArray · Math · Divide and ConquerMediumNearest Points to the BaseGeometry · Array · MathMediumRebalance a Search TreeGreedy · Tree · Depth-First SearchMediumOther Orders for the Same Search TreeTree · Union Find · Binary Search TreeHardCost of Filling a Sorted ShelfBinary Indexed Tree · Segment Tree · ArrayHardK-th Largest Corner XORBit Manipulation · Array · Divide and ConquerMediumBoth Cases StretchBit Manipulation · Hash Table · StringEasyArray From Its Subset SumsArray · Divide and ConquerHardK-th Biggest Long NumberArray · String · Divide and ConquerMediumOnes Outnumber ZerosBinary Indexed Tree · Segment Tree · ArrayMediumTriples Both Rankings Agree OnBinary Indexed Tree · Segment Tree · ArrayHardK-th Code by Its Last DigitsArray · String · Divide and ConquerMediumRising Chain With Small StepsBinary Indexed Tree · Segment Tree · QueueHardPairs Within a Shifted GapBinary Indexed Tree · Segment Tree · ArrayHardTowers Above Both NeighbourhoodsBinary Indexed Tree · Segment Tree · ArrayHardNearest Pair of SensorsGeometry · Array · MathHardNodes That Outrank Their SubtreeTree · Depth-First Search · Divide and ConquerHardRank of an ArrangementBinary Indexed Tree · Segment Tree · ArrayMediumSpaced Picks After EditsSegment Tree · Array · Divide and ConquerHard