Dream11 Interview Question

3 Sums and zigzag pattern