Question: Given an unsorted array A of size N that contains only positive integers, find a continuous sub - array that adds to a given number
Given an unsorted array A of size N that contains only positive integers, find a continuous subarray that adds to a given number and return the left and right indexbased indexing of that subarray.
In case of multiple subarrays, return the subarray indexes which come first on moving from left to right.
Note: You have to return an ArrayList consisting of two elements left and right. In case no such subarray exists return an array consisting of element
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
