Pinterest Interview Question

Leetcode recursion question for strings