Problem Statement is not clear , Can you explain in details ?
Problem Statement is not clear ,
Hi Abhishek
Lets understand this with the help of given test case.
3
1 2 3
So here the contiguous subarrays with all distinct elements are:
1 whose length is 1
2 whose length is 1
3 whose length is 1
1 2 whose length is 2
2 3 whose length is 2
1 2 3 whose length is 3
Therefore answer is
1+1+1+2+2+3=10%(10^9+7) = 10
I hope this is helpful.
Thank You
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.