Recursion

Define the answer in terms of the same problem on a smaller input, with a base case that stops the descent. The tell is a definition that repeats itself, as in Pow(x, n). Halving the input each time, as that one does, turns a linear loop into logarithmic time.

9 problems · 3 to practice in an AI round

Recursion problems
#ProblemDifficultyVideoAI round
1Pow(x, n)Medium—
2Permutation SequenceHard—AI round
3Power of ThreeEasy—
4Count Good NumbersMedium—AI round
5Find Kth Bit in Nth Binary StringMedium—AI round
6Elimination GameMedium—
7Finding 3-Digit Even NumbersEasy—
8Special Binary StringHard—
9Unique 3-Digit Even NumbersEasy—

Practice in an AI round

Three of these are AI rounds: 30 minutes, an AI agent beside your code, then a scored report.

Practice Permutation Sequence in an AI round