Recursion coding problems

Recursion is the base of backtracking, trees and divide and conquer. Practise writing the base case first and trusting the smaller call.

22 problems: 11 easy, 10 medium, 1 hard. Free to read; a free account solves them and earns XP and Aura.

  1. Count DigitsPractice · +10 XPeasy
  2. Count Paths on a LinePractice · +10 XPeasy
  3. Count Subsequences Summing to KPractice · +10 XPeasy
  4. Print Numbers in Reverse OrderPractice · +10 XPeasy
  5. Recursive FactorialPractice · +10 XPeasy
  6. Reverse ArrayPractice · +10 XPeasy
  7. Reverse Number DigitsPractice · +10 XPeasy
  8. Root to Leaf Path SumPractice · +10 XPeasy
  9. Sum of Array ElementsPractice · +10 XPeasy
  10. Sum of DigitsPractice · +10 XPeasy
  11. Sum of Subtree SizesPractice · +10 XPeasy
  12. Balanced Parentheses CheckPractice · +20 XPmedium
  13. Count Pairs with Equal XOR SumPractice · +20 XPmedium
  14. Find Minimum Depth Binary TreePractice · +20 XPmedium
  15. Lexicographically Smallest PathPractice · +20 XPmedium
  16. Longest Zigzag SubsequencePractice · +20 XPmedium
  17. Maximum Sum Increasing SubsequencePractice · +20 XPmedium
  18. Maximum Sum Non-Adjacent PairsPractice · +20 XPmedium
  19. Subsegment Sum Divisible by KPractice · +20 XPmedium
  20. Sum of Distinct ElementsPractice · +20 XPmedium
  21. Sum of Two Adjacent ElementsPractice · +20 XPmedium
  22. Longest Increasing Subsequence on a PermutationPractice · +30 XPhard