Plz explain me about the sample test case
mujhe samajh nhi aa rha ki is sample input ka answer 10 kaise aaya
Subarray with distinct elements
Following are the subarrays,with their lengths with all distinct elements.
1,2,3 - 3
1,2 -2
2,3 -2
1 -1
2 -1
3 -1
sum = 3+2+2+1+1+1 = 10
agr input ye hai:-
5
1 2 3 2 1
iska output kya hoga??explain krdena plz.
123
12
23
1
2
3
321
32
21
2
1
These would be all possible continous subarrays with all elements distinct
Note that it doesn’t matter weather unique subarrays are formed or not.
Answer shall be 19
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.