Shopee Interview Question

Recursion question on an 1D array