Is there any better approach to Generate Subarrays?

Is there any better approach to generate subarrays form a given array.

You can generate the subarrays using 3 loops only, there is no other way to do that, thus time complexity will be o(n^3) only.

Since, you arent replying anything, I am marking this doubt as resolved, You can reopen it if you face any issue…