Doubt in the code of "generating subarrays"

if i give n=4;
and input the array(1,3,4,5) it will print all the subarrays including (1,3) which is not a subarray,so can we overcome this problem.

@Mukesh_1
Hello Mukesh ,
A subarray is a contiguous part of array.
here (1,3) is continuous as well i.e 1 and 3 are one after another therefore it is also considered as a subarray.
I hope it clears your doubt.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.