Aptiv Interview Question

Recursive and stack