Nutanix Interview Question

Basic recursive algorithm.