Regarding my solution in python3:
My code fails to pass the "single possibility" test unless I hard-code the output being the first item's address. Unfortunately I cannot debug the "hidden" tests, so I do not know where the error occurs. Even if I simulate a single correct input, it still passes any of the regular test cases.
This is my code with what I expect a "single possibility" test would look like:
lon = 3.879483
lat = 43.608177
defib = []
defib = defib.append('1;Maison de la Prevention Sante;6 rue Maguelone 340000 Montpellier;;3,87952263361082;43,6071285339217'.replace(',','.').split(';'))
'''
this means defib = [['1', 'Maison de la Prevention Sante', '6 rue Maguelone 340000 Montpellier', '', '3.87952263361082', '43.6071285339217']] and len(defib) = 1
'''
min = math.pi*6371
output = ''
for location in defib:
x = (lon - float(location[4]))*math.cos((lat+float(location[5]))/2)
y = lat - float(location[5])
d = math.sqrt(x*x+y*y)*6371*(math.pi/180)
if d < min:
min = d
output = location[1]
print(output)
This generates the output "Maison de la Prevention Sante" with min before being 20015.086796020572 and min after being 0.11662777224653707.
Yet, I fail at "single possibility" unless i hardcode the initial to output = defib[0][1]. Any clues? Maybe there is something with lists that I'm missing or the test case is a little buggy?