Subarrays with distinct elements

Why am i getting run-error in some test cases?

Well you should declare arr[N] once you know N.
Declare it after getting N.
That’s why you are getting runtime error.

I hope i have cleared your doubt. You may close the thread if so :smile:
Please leave a rating :slight_smile:

1 Like

Thanks it helped me getting the right answer

Thats great. You may close the thread now