Can you tell my mistake?

hello @vageesha

which question u are solving?

subarrays with distinct elements

then why u are looking for A[start]+1 ,A[start]+2 … as next elements of subarray.

it should be A[start] , A[start+1] ,A[start+2] so on

I thought contiguous sub array means that the elements which we take must be adjacent, like 5,6,7…like this.

no , subarray with distinct elements means.
whatever subarray u have considered ,it should have distinct elements in it.

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.