Zeta Interview Question

1 stack question and one on diffrence array