Infosys Interview Question

To find the sub array