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!