Generating All Subarrays
Given an array arr[], the task is to generate all the possible subarrays of the given array. Examples: Input: arr[] = [1, 2, 3]Output: [ [1], [1, 2], [2], [1, 2, 3], [2, 3], [3] ]Input: arr[] = [1, 2]Output: [ [1], [1, 2], [2] ] Iterative ApproachTo generate a subarray, we need a starting index from