RingCentral Interview Question

A DSA involving sub array