Dream11 interview question

3 Sums and zigzag pattern