Solve a lot. Mostly a little above your level.
Rating grows from volume and honest effort: pick problems about 100–300 above your current rating, give each one real time, and upsolve what you miss in contests. This page keeps the list; Codeforces is where the work happens.
Connect your handle to mark solved problems automatically and get problems in your zone. No password needed — only public data.
Connect a handle for personalised picks; until then they follow the rung you select below.
Loading…
Rating ladder
LeetCode by topic
0/154 solved · free problems onlyThe interview-style set: every LeetCode problem from the lessons, grouped by technique in learning order. Good for placement and interview prep; pair it with Codeforces for contest speed.
Complexity and Constraints
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPower of TwoEasy
Math Basics for Contests
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPalindrome NumberEasy
- LCAdd DigitsEasy
Implementation and Simulation
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCFizz BuzzEasy
- LCRobot Return to OriginEasy
- LCSpiral MatrixMedium
- LCRotate ImageMedium
- LCGame of LifeMedium
Sorting and Binary Search Basics
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCSearch Insert PositionEasy
STL and Java Collections
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCTwo SumcoreEasy
- LCContains DuplicateEasy
- LCValid AnagramEasy
Arrays and Strings
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMove Zeroesthe in-place write pointerEasy
- LCValid PalindromeEasy
- LCIs SubsequenceEasy
Prefix Sums
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCRange Sum Query - ImmutableEasy
- LCRange Sum Query 2D - ImmutableMedium
- LCSubarray Sum Equals KMedium
- LCCorporate Flight BookingsMedium
Hashing and Frequency Counting
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCGroup Anagramsa sorted word is a good map keyMedium
- LCLongest Consecutive Sequencea set, and only start from sequence beginningsMedium
Two Pointers
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCTwo Sum II - Input Array Is SortedMedium
- LCContainer With Most WaterMedium
- LC3SumMedium
Sliding Window
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMaximum Average Subarray IEasy
- LCLongest Substring Without Repeating CharacterscoreMedium
- LCMinimum Size Subarray SumMedium
- LCPermutation in StringMedium
- LCSliding Window MaximumHard
Binary Search
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCBinary SearchEasy
- LCSqrt(x)last index where mid * mid <= xEasy
- LCFind First and Last Position of Element in Sorted ArrayMedium
- LCSearch in Rotated Sorted ArrayMedium
- LCFind Peak Elementbinary search without sorted dataMedium
Binary Search on the Answer
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCKoko Eating BananasMedium
- LCCapacity To Ship Packages Within D DayscoreMedium
- LCMagnetic Force Between Two Ballsmaximise the minimum distanceMedium
Stacks, Queues and Monotonic Structures
0/6 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCValid ParenthesescoreEasy
- LCRemove All Adjacent Duplicates In Stringthe string itself is the stackEasy
- LCNext Greater Element IEasy
- LCMin Stackstore the running minimum next to each valueMedium
- LCDaily Temperaturescorenext greater element, answer is the distanceMedium
- LCLargest Rectangle in Histogramnearest smaller on both sidesHard
Recursion
0/6 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCFibonacci NumberEasy
- LCMaximum Depth of Binary Treethe answer for a node comes from its two childrenEasy
- LCClimbing Stairsrecursion, then add a cacheEasy
- LCMerge Two Sorted ListsEasy
- LCReverse Linked Listdo it both recursively and with a loopEasy
- LCPow(x, n)corehalve the exponentMedium
Backtracking
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCSubsetscoreMedium
- LCPermutationscoreMedium
- LCCombinationschoose k of n, prune when too few numbers remainMedium
- LCGenerate Parenthesesprune when closers would exceed openersMedium
- LCCombination SumMedium
- LCWord Searchmark a cell, explore, unmarkMedium
- LCN-QueensHard
Bit Manipulation
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCSingle NumberXOR cancels pairsEasy
- LCNumber of 1 BitsEasy
- LCCounting Bitspopcount of every number up to nEasy
- LCMissing NumberEasy
Greedy Algorithms
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCAssign CookiesEasy
- LCNon-overlapping IntervalsMedium
Sweep Line and Intervals
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMerge IntervalscoreMedium
- LCCar PoolingMedium
- LCInsert IntervalMedium
- LCDivide Intervals Into Minimum Number of GroupsMedium
Number Theory Basics
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCCount PrimesMedium
Combinatorics
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPascal's TriangleEasy
- LCUnique PathsMedium
Heaps and Priority Queues
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCLast Stone WeightEasy
- LCKth Largest Element in an ArraycoreMedium
- LCTop K Frequent ElementsMedium
- LCMerge k Sorted ListscoreHard
- LCFind Median from Data Streamtwo heapsHard
Trees Basics
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDiameter of Binary TreeEasy
Graphs, BFS and DFS
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCNumber of IslandsMedium
- LCIs Graph Bipartite?Medium
Topological Sort
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCCourse ScheduleMedium
- LCCourse Schedule IIMedium
- LCFind Eventual Safe Statesrun Kahn on the reversed graphMedium
Shortest Paths
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCNetwork Delay TimeMedium
- LCCheapest Flights Within K StopsBellman-Ford with a limited number of roundsMedium
Disjoint Set Union
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCNumber of ProvincesMedium
- LCRedundant Connectionthe union that returns false is the extra edgeMedium
Minimum Spanning Tree
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMin Cost to Connect All Pointsa complete graph, so Prim without a heap works wellMedium
Dynamic Programming Basics
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMin Cost Climbing StairsEasy
- LCMinimum Cost For Ticketscorestate = day indexMedium
1D DP Patterns
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCHouse Robbercoretake or skipMedium
- LCCoin ChangecoreMedium
- LCCoin Change IIcount combinations; loop order mattersMedium
- LCDecode WaysMedium
- LCJump Game IIDP first, then the greedy O(n)Medium
DP on Grids and Strings
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMinimum Path SumMedium
- LCLongest Common SubsequencecoreMedium
- LCEdit DistancecoreMedium
- LCLongest Palindromic SubsequenceLCS of a string with its reverseMedium
Knapsack DP
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPartition Equal Subset Sumcoresubset sum with target = total / 2Medium
- LCLast Stone Weight IIsplit into two groups with the smallest differenceMedium
- LCTarget Sumcount subsets after a rewriteMedium
- LCOnes and Zeroesknapsack with two capacitiesMedium
Longest Increasing Subsequence
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCLongest Increasing SubsequencecoreMedium
- LCMaximum Length of Pair Chainsort, then LIS-styleMedium
- LCNumber of Longest Increasing Subsequencekeep a count next to each lengthMedium
- LCRussian Doll Envelopessort by width ascending, height descending, then LIS on heightHard
Tree DP and Rerooting
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCHouse Robber IIIcorethe independent-set DP of this lessonMedium
- LCBinary Tree Maximum Path SumHard
- LCSum of Distances in Treethe second program of this lessonHard
Bitmask DP
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCFair Distribution of Cookiesn is tiny; brute force is possible, bitmask DP is the clean versionMedium
- LCMinimum Number of Work Sessions to Finish the Tasksdp[mask] = best (sessions, load)Medium
- LCPartition to K Equal Sum SubsetsMedium
- LCShortest Path Visiting All NodesBFS over (mask, node) statesHard
Digit DP
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCNumbers At Most N Given Digit SetHard
- LCNon-negative Integers without Consecutive OnesHard
- LCCount Special Integerscorestate = mask of used digitsHard
- LCNumbers With Repeated Digitscount the complementHard
- LCNumber of Digit Onecount how often a digit appears, not just how many numbersHard
Fenwick Tree
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCRange Sum Query - MutableMedium
- LCCount of Smaller Numbers After SelfHard
- LCReverse Pairscompress values and count with a treeHard
Lazy Propagation
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMy Calendar IIIrange add, global maximumHard
- LCFalling Squaresrange chmax-assign, range maxHard
LCA and Binary Lifting
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCLowest Common Ancestor of a Binary Treethe plain recursive version, to see the definition at workMedium
- LCKth Ancestor of a Tree NodeHard
Small-to-Large Merging and DSU on Tree
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCAccounts Mergemerge lists of emails, smaller into largerMedium
String Hashing
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCFind the Index of the First Occurrence in a Stringrolling hash as a warm-upEasy
- LCLongest Duplicate Substringcorebinary search on the length, a set of window hashesHard
- LCDistinct Echo SubstringsHard
KMP and Z-function
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCLongest Happy Prefixthe last value of the prefix functionHard
- LCSum of Scores of Built Stringsthe sum of the Z-functionHard
Trie (Prefix Tree)
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCImplement Trie (Prefix Tree)coreMedium
- LCMaximum XOR of Two Numbers in an ArraycoreMedium
- LCWord Search IIHard
Game Theory, Nim and Grundy Numbers
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
Probability and Expected Value
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCKnight Probability in Chessboardprobability DP over stepsMedium
- LCNew 21 Gameprobability DP with a sliding window sumMedium
Matrix Exponentiation
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCKnight Dialerwalks on a 10-vertex graphMedium
SCCs, Bridges and Articulation Points
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCCritical Connections in a NetworkcoreHard
Interactive Problems
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCGuess Number Higher or Lowerthe same idea behind an API callEasy
Design a News Feed
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign TwitterMedium
Design a Food Delivery System
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign a Food Rating SystemMedium
Command
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign Browser HistoryMedium
Threads and Locks
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPrint in OrderEasy
- LCPrint FooBar AlternatelyMedium
- LCThe Dining PhilosophersMedium
LLD Interview Framework
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign Underground SystemMedium
- LCDesign Authentication ManagerMedium
- LCTime Based Key-Value StoreMedium
- LCDesign SpreadsheetMedium
Parking Lot
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign Parking SystemEasy
LRU Cache
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
BookMyShow
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
Order Matching Engine
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCStock Price Fluctuation Medium
From the lessons
Every practice set, in lesson order. Learn the idea first — open the track — then come back here.
DSA0/506
Start Here
0/6 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFWatermeloncoreyour first submission800
- CFWay Too Long Wordscore800
- CFTeam800
- CFBit++800
- CFTheatre Squareneeds a 64-bit integer1000
- CSESWeird Algorithm
How to Think About a Problem
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFCandies and Two Sisters800
- CFYet Another Two Integers Problem800
- CFMinimal Squarecore800
- CFSum of Round Numberscorework the examples by hand first800
- CFCards for Friends800
- CFOrdinary Numbers800
- CFOdd Divisor900
- CFExpression1000
- CFSame Parity Summandsa little above the band1200
Language Setup and Contest Template
0/8 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFSumcoremultiple test cases800
- CFA+B Again?800
- CFPlus or Minus800
- CFDivision?800
- CFElephant800
- CFSoldier and Bananascorea sum that grows800
- CSESIncreasing Array
- CSESBit Stringsmodulo 10^9+7
Complexity and Constraints
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFDivisibility Problem800
- CFMaximum GCDcoredo not try every pair800
- CFSum of Cubes1100
- CFK-th Not Divisible by ncorek is up to 10^91200
- CSESMissing Number
- CSESTrailing Zerosn up to 10^9
- LCPower of TwoEasy
Math Basics for Contests
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFFloor Numberceiling division800
- CFRestoring Three Numbers800
- CFLCM Problem800
- CFGame with Integers800
- CFEven Oddscore900
- LCPalindrome NumberEasy
- LCAdd DigitsEasy
Implementation and Simulation
0/14 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFBeautiful Matrixcore800
- CFTram800
- LCFizz BuzzEasy
- LCRobot Return to OriginEasy
- CFStones on the Table800
- CFPetya and Stringscore800
- CFWord Capitalization800
- CFFootball900
- CFString Taskcore1000
- CFChat room1000
- CFXenia and Ringroadsimulate, watch the wrap-around1000
- LCSpiral MatrixMedium
- LCRotate ImageMedium
- LCGame of LifeMedium
Sorting and Binary Search Basics
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFHelpful Maths800
- CFMedium Number800
- CFTwinscore900
- CFGravity Flip900
- CFDragonscore1000
- CFInteresting drinkcoresort once, then search for each query1100
- CFWorms1200
- CFVanya and Lanterns1200
- CFQueries about less or equal elementsa little above the band1300
- CSESDistinct Numbers
- LCSearch Insert PositionEasy
STL and Java Collections
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFPangram800
- CFICPC Balloons800
- CFWord Gamecore800
- CFAdvantage800
- CFA and B and Compilation Errors1100
- CFSame Differencescorecount with a map1200
- CFMatryoshkas1200
- CSESConcert Ticketsneeds a sorted multiset
- LCTwo SumcoreEasy
- LCContains DuplicateEasy
- LCValid AnagramEasy
Arrays and Strings
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFBoy or Girlcoredistinct letters with a frequency array800
- CFDo Not Be Distracted!corefrequency array plus one pass800
- CFShort Substrings800
- CFReverse a Substringlook at adjacent pairs1000
- LCMove Zeroesthe in-place write pointerEasy
- LCValid PalindromeEasy
- LCIs SubsequenceEasy
Prefix Sums
0/12 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCRange Sum Query - ImmutableEasy
- CSESStatic Range Sum Queries
- CFIlya and Queriescoreprefix counts over adjacent pairs1100
- CFThree Parts of the Arrayprefix sums plus two pointers1200
- LCRange Sum Query 2D - ImmutableMedium
- CFKaren and Coffeecoredifference array, then prefix counts1400
- CFLittle Girl and Maximum Sumdifference array, then sort and match1500
- LCSubarray Sum Equals KMedium
- LCCorporate Flight BookingsMedium
- CSESSubarray Sums II
- CFZero-Sum Prefixes1600
- CFNumber of Wayscoresplit into three equal-sum parts1700
Hashing and Frequency Counting
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCGroup Anagramsa sorted word is a good map keyMedium
- CFRegistration Systemmap from a name to how often it was used1300
- CFYarik and Musical Notesfind a pair-equality rewrite, then count1300
- LCLongest Consecutive Sequencea set, and only start from sequence beginningsMedium
- CFWinnertwo passes with a map1500
Two Pointers
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFFavorite Sequence800
- CFSereja and Dima800
- CFEating Candiescoreleft and right pointers with running sums1100
- CFBerSU Ballcoresort, then match from both lists1200
- LCTwo Sum II - Input Array Is SortedMedium
- CSESSum of Two Valueskeep the original indices when you sort
- CSESFerris Wheel
- CFNumber of Pairscorecount pairs with sum in a range1300
- LCContainer With Most WaterMedium
- CFPair of Topics1400
- LC3SumMedium
Sliding Window
0/12 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFBlack and White Stripecorefixed window1000
- CFSki Resortcount segments by their length1000
- LCMaximum Average Subarray IEasy
- CSESPlaylistlongest window with all values distinct
- CFTernary Stringshortest window containing 1, 2 and 31200
- CFBinary Dequecorelongest window with a given sum1200
- LCLongest Substring Without Repeating CharacterscoreMedium
- LCMinimum Size Subarray SumMedium
- CFBookslongest window with sum at most t1400
- CFVasya and Stringcorewindow with at most k letters to change1500
- LCPermutation in StringMedium
- LCSliding Window MaximumHard
Binary Search
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCBinary SearchEasy
- LCSqrt(x)last index where mid * mid <= xEasy
- CFEating Queriesprefix sums are sorted, so search them1100
- LCFind First and Last Position of Element in Sorted ArrayMedium
- CFT-primes1300
- LCSearch in Rotated Sorted ArrayMedium
- LCFind Peak Elementbinary search without sorted dataMedium
Binary Search on the Answer
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCKoko Eating BananasMedium
- CFBuilding an Aquariumcorefind the largest height whose water fits1100
- CFPoisoned Dagger1200
- LCCapacity To Ship Packages Within D DayscoreMedium
- CSESFactory Machines
- CFMaximum Mediancoremaximise the median under an operation budget1400
- LCMagnetic Force Between Two Ballsmaximise the minimum distanceMedium
- CFMagic Powder - 21500
- CSESArray Division
- CFHamburgers1600
- CFPresentthe check uses a difference array1700
Stacks, Queues and Monotonic Structures
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFMove Bracketscorebalance counter, the stack idea without the stack1000
- LCValid ParenthesescoreEasy
- LCRemove All Adjacent Duplicates In Stringthe string itself is the stackEasy
- LCNext Greater Element IEasy
- CFRegular Bracket Sequencelongest regular subsequence, count matched pairs1400
- LCMin Stackstore the running minimum next to each valueMedium
- LCDaily Temperaturescorenext greater element, answer is the distanceMedium
- CFQueuefarthest smaller element to the right1500
- LCLargest Rectangle in Histogramnearest smaller on both sidesHard
- CFMike and Feetstretch; span in which each bar is the minimum1900
Recursion
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCFibonacci NumberEasy
- LCMaximum Depth of Binary Treethe answer for a node comes from its two childrenEasy
- LCClimbing Stairsrecursion, then add a cacheEasy
- LCMerge Two Sorted ListsEasy
- LCReverse Linked Listdo it both recursively and with a loopEasy
- CFGold Rushcoretry the split, recurse on both parts1000
- CFTransformation: from A to Bwork backwards from b1000
- LCPow(x, n)corehalve the exponentMedium
- CFPermutation Transformationcoresplit the range at the maximum1200
- CFMasha and a Beautiful Treerecurse on halves of the array1300
- CFa-Good Stringstretch; two choices per level1500
Backtracking
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFPetr and a Combination Lockcoretry both directions for every rotation1200
- LCSubsetscoreMedium
- LCPermutationscoreMedium
- CFDreamoon and WiFitry every way to fill the unknown commands1300
- LCCombinationschoose k of n, prune when too few numbers remainMedium
- CFPreparing Olympiadevery subset of at most 15 problems1400
- LCGenerate Parenthesesprune when closers would exceed openersMedium
- LCCombination SumMedium
- LCWord Searchmark a cell, explore, unmarkMedium
- CSESChessboard and QueenscoreN-Queens with blocked squares
- LCN-QueensHard
Bit Manipulation
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFAnd Then There Were Kcorelook at the highest set bit of n800
- LCSingle NumberXOR cancels pairsEasy
- LCNumber of 1 BitsEasy
- LCCounting Bitspopcount of every number up to nEasy
- CFRaising Bacteriacorethe answer is a popcount1000
- CFRoof Constructionsplit at the largest power of two below n1000
- LCMissing NumberEasy
- CFRock and Levercoregroup numbers by highest set bit1200
- CSESApple Divisiontry every subset with a mask
- CFMaximal ANDdecide bits from the highest to the lowest1300
- CFAGAGA XOOORRRXOR of all elements decides the number of parts1500
Constructive Algorithms
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFEhAb AnD gCd800
- CFBalanced Arraycorethe worked example in this lesson800
- CFMake it Beautiful800
- CSESPermutations
- CFDifferent Divisors1000
- CFChallenging Cliffscoresort, then place the closest pair at the two ends1200
- CFOdd Sum Segments1200
- CFSegments1300
- CFPhoenix and Beauty1400
Greedy Algorithms
0/5 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCAssign CookiesEasy
- CSESMovie Festivalcorethe activity selection problem from this lesson
- CSESTasks and Deadlines
- LCNon-overlapping IntervalsMedium
- CFNested Segments1500
Sweep Line and Intervals
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFPoints in Segments800
- CFFree Cashthe largest number of customers at the same minute1000
- CSESRestaurant Customerscoremaximum overlap, the template of this lesson
- LCMerge IntervalscoreMedium
- LCCar PoolingMedium
- LCInsert IntervalMedium
- LCDivide Intervals Into Minimum Number of GroupsMedium
- CFCovered Points Countcorehuge coordinates, events in a map1700
- CFToo Many Segments (easy version)1800
Number Theory Basics
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFAlmost Prime900
- CFLucky Division1000
- LCCount PrimesMedium
- CFBuying Shovels1300
- CFProduct of Three Numbers1300
- CFk-th divisor1400
- CFFadi and LCMcoregcd, lcm and divisors together1400
- CFRow GCDcoregcd(a, b) = gcd(a, b - a)1600
- CSESCounting Divisors
Modular Arithmetic
0/8 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFModular Exponentiation900
- CSESExponentiation
- CFAND 0, Sum Bigcorethe answer is k to the power n, modulo 10^9 + 71200
- CFDivisible Pairs1300
- CSESExponentiation II
- CFAND Sequencescorecount with factorials, take the result modulo p1400
- CSESBinomial Coefficients
- CFAdvertising AgencycorenCr modulo a prime1600
Combinatorics
0/8 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPascal's TriangleEasy
- CFPasha and Stick1000
- LCUnique PathsMedium
- CFForming Trianglescoregroup by length, then choose with nCr1200
- CFRandom Teams1300
- CFTwo Round Dances1300
- CFK-th Beautiful String1300
- CFBall in Berlandcoretotal pairs minus bad ones, an inclusion-exclusion step1400
Heaps and Priority Queues
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCLast Stone WeightEasy
- CFSnacktowera heap of what has arrived, release the largest when it is due1100
- LCKth Largest Element in an ArraycoreMedium
- LCTop K Frequent ElementsMedium
- CFEpic Transformationcorealways pair the two most frequent values1400
- LCMerge k Sorted ListscoreHard
- CSESRoom Allocationheap of room end times
- CFConstructing the Array1600
- CFHeap Operations1600
- CFPotions (Hard Version)coreundo the worst past choice with a max-heap1600
- LCFind Median from Data Streamtwo heapsHard
Trees Basics
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDiameter of Binary TreeEasy
- CSESSubordinatescoresubtree sizes, exactly the second half of this lesson
- CSESTree Diameter
- CFBegginer's Zelda1100
- CFChristmas Spruce1200
- CFApple Tree1200
- CFWhite-Black Balanced Subtreescorecount something inside every subtree1300
- CFQueen1400
- CFKefa and ParkcoreDFS that carries a running count down the path1500
- CFCut 'em all!1500
Graphs, BFS and DFS
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFNew Year Transportation1000
- CFThe Lakescorecomponents on a grid, the simplest real use of DFS or BFS1100
- LCNumber of IslandsMedium
- CFIce Skatingcomponents where "connected" needs one observation1200
- CSESMessage RoutecoreBFS plus printing the path
- LCIs Graph Bipartite?Medium
- CFCyclic Components1500
- CFNP-Hard Problemcore2-colouring with a twist in the output1500
- CFValid BFS?what exactly can a BFS order look like1700
- CFSolve The Mazegrid reachability with a greedy wall placement1700
Topological Sort
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCCourse ScheduleMedium
- LCCourse Schedule IIMedium
- CSESCourse Schedulecoreprint the order, or IMPOSSIBLE on a cycle
- LCFind Eventual Safe Statesrun Kahn on the reversed graphMedium
- CSESLongest Flight RouteDP over a DAG with a path to print
- CFFox And Namesbuild the letter order from adjacent names, then sort1600
- CFSubstringcoreDP on a DAG for every letter, a cycle means infinity1700
- CFBooklongest chain with a twist on the cost of each edge1800
- CFDirecting Edgescoreorder the directed edges first, then orient the rest by that order2000
- CFGourmet choicemerge equal items with DSU, then longest path on layers2000
Shortest Paths
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCNetwork Delay TimeMedium
- CSESShortest Routes Icoreplain Dijkstra, the first one to write from memory
- CSESShortest Routes IIall pairs, Floyd-Warshall
- LCCheapest Flights Within K StopsBellman-Ford with a limited number of roundsMedium
- CSESCycle Findingnegative cycle with Bellman-Ford, and print it
- CFGreg and GraphFloyd-Warshall, read the statement for the order of k1700
- CFLabyrinthcore0-1 BFS on a grid1800
- CFBicycles1800
- CFRendez-vous de Marian et RobinDijkstra with a state (node, has a horse)1800
- CFDijkstra?corethe classic, with path printing1900
- CFPaths and Trees2000
Disjoint Set Union
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCNumber of ProvincesMedium
- LCRedundant Connectionthe union that returns false is the extra edgeMedium
- CSESRoad Constructioncorethis lesson's template, almost word for word
- CFDZY Loves Chemistrythe answer depends only on the number of components1400
- CFNews Distributioncorecomponent sizes1400
- CFLearning Languagesone corner case when nobody knows any language1400
- CFKnight Tournamentcorethe "next free index" use of DSU1500
- CFBear and Friendship Condition1500
- CFThe Number of ImpostersDSU with a parity (same or different) on each link1700
- CFRoads not only in Berlandfind the useless edges and reuse them to connect the components1900
Minimum Spanning Tree
0/8 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMin Cost to Connect All Pointsa complete graph, so Prim without a heap works wellMedium
- CSESRoad Reparationcorethe template, plus printing IMPOSSIBLE
- CFRoad Reformcorebuild the MST, then think about which edge is closest to the target1800
- CFShichikuji and Power Gridcoreadd a virtual node so that "build a station" becomes "take an edge"1900
- CFMake It Connectedonly a few edges can matter1900
- CF0-1 MSTthe weight-0 edges are the complement of the input1900
- CFGCD and MST2000
- CFMST Unificationequal-weight edges, process them in groups2100
Dynamic Programming Basics
0/6 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCMin Cost Climbing StairsEasy
- CFFilling Shapesfind the recurrence on small n, then simplify it1000
- CFCut Ribboncorethe worked example below1300
- CFVacationscorestate = (day, what you did yesterday)1400
- LCMinimum Cost For Ticketscorestate = day indexMedium
- CFFlowersstretch; DP plus prefix sums for range queries1700
1D DP Patterns
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCHouse Robbercoretake or skipMedium
- CFBasketball Exercisetwo rows, never take two neighbours1400
- LCCoin ChangecoreMedium
- LCCoin Change IIcount combinations; loop order mattersMedium
- LCDecode WaysMedium
- LCJump Game IIDP first, then the greedy O(n)Medium
- CFBlock Sequencedp from the right end1500
- CFBoredomcorecount values, then it is House Robber1500
- CFk-Treeways to reach sum n; add a flag for the second condition1600
DP on Grids and Strings
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFCoin Rowsa grid with two rows; prefix sums are enough, but think of it as a path1300
- CSESGrid Pathsthe DP version, count paths around traps
- LCMinimum Path SumMedium
- LCLongest Common SubsequencecoreMedium
- LCEdit DistancecoreMedium
- CSESEdit Distance
- CFHard problemcoretwo states per string - reversed or not1600
- CFZero Pathstretch; keep the minimum and maximum sum per cell1700
- LCLongest Palindromic SubsequenceLCS of a string with its reverseMedium
Knapsack DP
0/8 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPartition Equal Subset Sumcoresubset sum with target = total / 2Medium
- CSESBook Shopcorethe plain 0/1 knapsack
- LCLast Stone Weight IIsplit into two groups with the smallest differenceMedium
- LCTarget Sumcount subsets after a rewriteMedium
- LCOnes and Zeroesknapsack with two capacitiesMedium
- CFBaby Ehab Partitions Againcoresubset sum, then remove one element1700
- CFWriting Codecounting variant with an unbounded flavour1800
- CFModulo Sumstretch; subset sum on remainders, with a pigeonhole shortcut1900
Longest Increasing Subsequence
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCLongest Increasing SubsequencecoreMedium
- CSESIncreasing Subsequencethe plain O(n log n) version with n up to 2*10^5
- CFBubble Sort Graphthe answer is an LIS of the permutation1500
- LCMaximum Length of Pair Chainsort, then LIS-styleMedium
- CFConsecutive Subsequencecorea hash map instead of a binary search1700
- CFMysterious PresentcoreLIS on pairs, with reconstruction1700
- LCNumber of Longest Increasing Subsequencekeep a count next to each lengthMedium
- LCRussian Doll Envelopessort by width ascending, height descending, then LIS on heightHard
- CFSubsequencesstretch; count increasing subsequences of a given length with a Fenwick tree1900
Tree DP and Rerooting
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCHouse Robber IIIcorethe independent-set DP of this lessonMedium
- LCBinary Tree Maximum Path SumHard
- CFChoosing Capital for Treelandrerooting with edge directions1700
- CFMaximum White Subtreecorethe standard rerooting problem1800
- CFDistance in Treedp[v][d] = vertices at depth d below v1800
- LCSum of Distances in Treethe second program of this lessonHard
- CFTree with Maximum Coststretch; same rerooting formula, different weights1900
Bitmask DP
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCFair Distribution of Cookiesn is tiny; brute force is possible, bitmask DP is the clean versionMedium
- LCMinimum Number of Work Sessions to Finish the Tasksdp[mask] = best (sessions, load)Medium
- LCPartition to K Equal Sum SubsetsMedium
- CFKefa and Dishescoredp[mask][last]1800
- CSESElevator Ridescoredp[mask] stores a pair, rides and the load of the last ride
- CSESHamiltonian Flightscorecount paths that visit every city once
- LCShortest Path Visiting All NodesBFS over (mask, node) statesHard
- CFLooking for Orderfix the lowest unset bit to avoid permutations2000
- CFRoman and Numbersmask of used digits plus remainder2000
- CFLittle Pony and Harmony Cheststretch; mask of used primes2000
Digit DP
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CSESCounting Numberscorethe program of this lesson
- LCNumbers At Most N Given Digit SetHard
- LCNon-negative Integers without Consecutive OnesHard
- LCCount Special Integerscorestate = mask of used digitsHard
- LCNumbers With Repeated Digitscount the complementHard
- CFClassy Numberscoreat most 3 non-zero digits, count in a huge range1900
- LCNumber of Digit Onecount how often a digit appears, not just how many numbersHard
- CFMagic Numbersposition parity and remainder modulo m2200
- CFSegment Sumstretch; at most k distinct digits, and you need the sum, not the count2300
- CFBeautiful numbersstretch; remainder modulo lcm(1..9) = 25202500
Sparse Table
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CSESStatic Range Minimum Queriesthe exact template of this lesson
- CFRorororobotrange maximum over columns decides if a path is blocked1700
- CFIntegers Have Friendscoregcd of adjacent differences, two pointers1800
- CFMax GEQ Sumcoresparse table for max, monotonic stack for the borders1800
- CFArray Stabilization (GCD version)coreduplicate the array, binary search on the number of steps1900
- CFCGCDSSQcount subarrays by gcd value2000
- CFFriends and Subsequencesbinary search where max - min is checked in O(1)2100
Fenwick Tree
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCRange Sum Query - MutableMedium
- CSESList Removalsfind the k-th remaining element, then delete it
- CFPashmak and Parmida's problemcorecount pairs with prefix count greater than suffix count1800
- CFEnemy is weakcorefor each middle element count smaller on the left, greater on the right1900
- CFMultisetcoreinsert, delete the k-th smallest; descend the tree1900
- LCCount of Smaller Numbers After SelfHard
- LCReverse Pairscompress values and count with a treeHard
- CFInfinite Inversionscompress the touched positions, count the gaps between them2100
- CFYaroslav and Divisorsoffline queries sorted by right end2200
Segment Tree
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CSESDynamic Range Sum Queriesthe exact template of this lesson
- CSESDynamic Range Minimum Queries
- CFDistinct Characters Queriescorestore a 26-bit mask per node and merge with OR1600
- CFXenia and Bit Operationscorethe merge operation alternates by level1700
- CFInteresting Arrayone tree per bit, or AND-merge with a build step1800
- CFSereja and Bracketscorenode = (matched pairs, open left, close right)2000
- CFThe Child and Sequencekeep max per node, skip segments where max < mod2300
Lazy Propagation
0/8 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CSESRange Update Queriesrange add, point query
- CFCopying Datacorerange assign, point query; the latest copy wins1900
- CFXOR on Segmentcoreone tree per bit, lazy flip2000
- CSESRange Updates and Sumsadd and assign tags together
- LCMy Calendar IIIrange add, global maximumHard
- CFCircular RMQcorerange add, range min, wrapped ranges2200
- LCFalling Squaresrange chmax-assign, range maxHard
- CFLucky Queriesnode keeps counts of 4 and 7; lazy flip and swap2400
Sqrt Decomposition and Mo's Algorithm
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CSESDistinct Values Queriescorethe textbook Mo's problem
- CFLittle Elephant and Arraycorecount values x that appear exactly x times in a range1800
- CFXOR and Favorite NumbercoreMo with prefix XORs2200
- CFPowerful arraymaintain a sum of cnt^2 * value2200
- CFAnn and Books2300
- CFTree and QueriesMo on the Euler tour order2400
- CFOne Occurrencesolvable with Mo, intended with sweep and segment tree2400
LCA and Binary Lifting
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCLowest Common Ancestor of a Binary Treethe plain recursive version, to see the definition at workMedium
- CSESCompany Queries IILCA of two employees
- CSESCompany Queries Ik-th ancestor
- CSESDistance Queries
- LCKth Ancestor of a Tree NodeHard
- CFTree Queriescorea path from the root through the deepest node must pass within one step of every query node1900
- CFFools and RoadscoreLCA plus a difference array on the tree1900
- CF1-Trees and Queriescoreshortest walk with one extra edge is the best of three distances2000
- CFA and B and Lecture Roomsthe middle of a path, then subtree sizes2100
- CFMinimum spanning tree for each edgestore the maximum edge on each jump2100
Euler Tour on Trees
0/7 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CSESSubtree Queriesthe exact template of this lesson
- CSESPath Queriesroot-to-node sums, range add and point query
- CFPropagating treecoreflip the sign of an update by depth parity2000
- CFDanil and a Part-time Jobcoreflip a whole subtree with a lazy segment tree2000
- CFBlood Cousinslists of tin per depth, then binary search2100
- CFNew Year Treecoreassign a colour to a subtree, count distinct colours with a bitmask2100
- CFLomsat gelraldominant colour of every subtree; the flat array enables the sack technique2300
Small-to-Large Merging and DSU on Tree
0/6 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFPath Queriesprocess edges by weight, merge components, track the pair count1800
- LCAccounts Mergemerge lists of emails, smaller into largerMedium
- CSESDistinct Colorscorenumber of distinct colours in every subtree
- CFTree Requestscoreletter counts per depth, can the letters form a palindrome2200
- CFDominant Indicescoremost frequent depth in each subtree2300
- CFBlood Cousins Return2400
String Hashing
0/8 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCFind the Index of the First Occurrence in a Stringrolling hash as a warm-upEasy
- CFPassworda prefix that is also a suffix and appears in the middle1700
- CFGood Substringscorecount distinct substrings by their hashes1800
- CFPrefix-Suffix Palindrome (Hard version)hashes of the string and its reverse give palindrome checks1800
- CFWatto and Mechanismcorefor each query, try changing each position and look up the hash2000
- CFCompress Wordslongest overlap of a suffix and a prefix2000
- LCLongest Duplicate Substringcorebinary search on the length, a set of window hashesHard
- LCDistinct Echo SubstringsHard
KMP and Z-function
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CSESString Matchingcount the occurrences of a pattern
- CSESFinding Bordersall borders of a string
- CSESFinding Periods
- CFMUH and Cube Wallscorematch differences of neighbouring heights, not the heights1800
- LCLongest Happy Prefixthe last value of the prefix functionHard
- CFTavas and Malekascorecheck overlaps with the Z-function, count free positions1900
- CFPrefixes and Suffixescoreall borders, each counted by how often it occurs2000
- LCSum of Scores of Built Stringsthe sum of the Z-functionHard
- CFAnthem of Berlandprefix function as an automaton inside a DP2300
Trie (Prefix Tree)
0/9 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCImplement Trie (Prefix Tree)coreMedium
- LCMaximum XOR of Two Numbers in an ArraycoreMedium
- CFVasiliy's Multisetcoreadd, remove and max-XOR queries; keep a count on every node1800
- CFA Lot of Gameswin/lose states on the nodes of a trie1900
- CFVitya and Strange LessonXOR every element by x, then find the mex with a trie2000
- CFChoosing The Commandercount numbers whose XOR with p is below l2000
- LCWord Search IIHard
- CFBeautiful Subarrayscoreprefix XORs plus counting pairs with XOR at least k2100
- CFSausage Maximization2200
Game Theory, Nim and Grundy Numbers
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCNim GameEasy
- CSESStick Gamewin/lose DP over positions
- CSESNim Game I
- CFNumber Gamecorereason about the last move before reaching for theory1400
- CFDeleting Divisorscoreprint win/lose for small n and find the pattern1700
- CFCircle Game1700
- CFStoned Game1800
- LCCan I Winwin/lose states over a bitmaskMedium
- CFGame of StonescoreGrundy value of each pile, then XOR2100
- CFLieges of LegendreGrundy values with a repeating pattern2200
Probability and Expected Value
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCKnight Probability in Chessboardprobability DP over stepsMedium
- CFJourneycoreexpected path length on a tree, one DFS1500
- CFRandom Eventsthe answer is 1 minus a product of probabilities1500
- CFLittle Pony and Expected MaximumcoreE[max] = sum over k of P(max >= k)1600
- CFIlya and Escalatorexpected value DP over time1700
- CFBag of mice1800
- LCNew 21 Gameprobability DP with a sliding window sumMedium
- CFLet's Play Osu!coremaintain the expected value of a running streak2000
- CFWish I Knew How to Sortcoreexpected-value DP with a self-loop, answer mod 9982443532000
- CFGame on Treelinearity, one indicator per vertex2200
Matrix Exponentiation
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFJzzhu and Sequencesthe recurrence has a short period, but try the matrix as practice1300
- CSESFibonacci Numbers
- CFTetrahedroncorecount walks of length n on four vertices1500
- CSESGraph Paths Icore
- CFAdd Oneusually done with DP; matrix power also works1600
- LCKnight Dialerwalks on a 10-vertex graphMedium
- CFXor-sequencescorebuild the adjacency matrix from a condition on pairs1900
- CFDecoding Genome1900
- CFWet Shark and Blocks2000
- CFMagic Gemscoref(n) = f(n-1) + f(n-m), a state of size m2100
- CFSasha and Arraymatrices stored in a segment tree2300
SCCs, Bridges and Articulation Points
0/10 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- CFStrongly Connected Citywarm-up, every vertex must reach every other1400
- CSESFlight Routes Check
- CSESPlanets and Kingdomsprint the SCC id of every vertex
- CFCheckpostscorecheapest vertex in each SCC, count the ways1700
- CFReachability from the Capitalcorecount source components in the condensation2000
- CFBertown roadscoreorient every edge along the DFS; a bridge makes it impossible2000
- CSESCoin Collectorcondense, then DP on the DAG
- LCCritical Connections in a NetworkcoreHard
- CFWe Need More Bossescontract the 2-edge-connected components, take the tree diameter2100
- CFTourist Reform2300
Interactive Problems
0/11 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCGuess Number Higher or Lowerthe same idea behind an API callEasy
- CFLost Numbersfour queries, then brute force the order1400
- CFBear and Prime 1001400
- CFRuler (easy version)binary search on a monotone reply1500
- CFGuess the K-th Zero (Easy version)corethe same idea as the example below1600
- CFGuessing the Greatest (easy version)corefind the second maximum with a range query1600
- CFChocolate Bunny1600
- CFFixed Point Guessing1600
- CFSearching Local Minimumcorebinary search where the "direction" is a comparison of neighbours1700
- CFRuler (hard version)1700
- CFGuessing the Greatest (hard version)1900
System Design0/2
Design a News Feed
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign TwitterMedium
Design a Food Delivery System
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign a Food Rating SystemMedium
LLD0/13
Command
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign Browser HistoryMedium
Threads and Locks
0/3 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCPrint in OrderEasy
- LCPrint FooBar AlternatelyMedium
- LCThe Dining PhilosophersMedium
LLD Interview Framework
0/4 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign Underground SystemMedium
- LCDesign Authentication ManagerMedium
- LCTime Based Key-Value StoreMedium
- LCDesign SpreadsheetMedium
Parking Lot
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCDesign Parking SystemEasy
LRU Cache
0/2 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
BookMyShow
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
Order Matching Engine
0/1 solvedEasiest first. Give each one an honest 30–45 minutes before reading a hint or the editorial. Core problems are the minimum.
- LCStock Price Fluctuation Medium