Hello all,
I have tried to solve the question using given k values. So if current k doesn't satisfy the condition i look to the left and to the right and whichever side gives me smallest one i consider that side and discard the other half.
c++ code https://codeforces.com/contest/1805/submission/235224707
python code https://codeforces.com/contest/1805/submission/235213482
Thank you.