« first day    last day (17 days later) » 

05:59
Hi
Can you see my comments here?
I tried to write down your idea as:
for i in range(N):
cur_point = points[i]
for j in range(i):
if i == 0 or j == 0:
M[i][j] = 0
elif j == i -1: # the first officer covered point i
_min = 1000
for k in range(i-1):
_min = min(_min, M[i-1,k] + get_dist(cur_point, points[k]))
M[i][j] = _min
else:
# the second officer covered the point i-1 and the second officer covered point i
M[i,j] = M[i-1,j] + get_dist(cur_point,points[i-1])

print(M)
return min(M[N-1])
Just the name I and K is switched
But the Matrix M doesn't include the answer.

« first day    last day (17 days later) »