Anduril interview question

Recursion question that could be found on leetcode