kgp summers

constantly getting WA
heres my code

The absolute value of each coordinate is less than or equal to 1000. So distance between two points may be greater than your m (= 1009) in min1(). This may return garbage value of index;
didn’t worked still the freaking WA is coming…:frowning:

??? changing initialisation of key[i] and m = 10^7 gives AC.