You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My suggestion to fix is this line: if (kanan[data[i]] == -1) kanan[data[i]] = i;
the kanan[data[i]] should be updated to the nearest i position so far instead of the rightMost one. So regardless of the initial value of kanan[data[i]], it should always be updated to i.
Hi Luqman, I feel like for the problem F of the Singapore ICPC Regional 2018, the solution in your repo is not correct for this test case:
7
3 4 3 4 5 3 5
The answer should be 3 4 while your F solution return 3 5.
I am looking forward to your response and thank you so much!
The text was updated successfully, but these errors were encountered: