Added algorithm for subarray problem