Code problem with generating subarrays

why the third loop is used for the generation of subarrays.if suppose my i and j are at same indexes in an array then how many subarrys can be generated

why TA,S are not replying…2 din hogye problem resolved nhi hui…aisa kyu

hello @rishabhkumargupta97

just now ur doubt shown in live portal.
agar reply nahi aata hai to doubt reopen kar diya karo.

total subarrays will be n * (n+1)/2

if i ==j then only one subarray

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.