StackAdapt Interview Question

Walk through the code written.