Squarespace interview question

LC Reccursion and Arrays problem