do minimal distance search
codeeval fails weirdly (single 0.0 distance), might need to implement solution without the use of common array