please explain the problem count subarrays in practice beginner

Example case 1.
All valid subarrays are A[1, 1], A[1, 2], A[2, 2], A[3, 3], A[3, 4], A[4, 4].
why not A[1,3] and A[1,4].

Sub arrays must be contiguous, meaning, the end and start indexes should be continuous.

like [1,2,3] - Indices connected/ in sequence of index 0,1,2.

In your example, its index 3 after index 0, so 1,4 is not a sub array.

ELEMENTS OF SUB ARRAY MUST BE CONTINUOUS IN ORIGINAL ARRAY.

//