Meta interview question

Leet code question, hard difficulty level, recursion.