MyDen Gió lạnh đầu buồi 3/4/25 #2 Code: def escapeGhosts(ghosts, target): player_dist = abs(target[0]) + abs(target[1]) for gx, gy in ghosts: ghost_dist = abs(gx - target[0]) + abs(gy - target[1]) if ghost_dist <= player_dist: return False return True
Code: def escapeGhosts(ghosts, target): player_dist = abs(target[0]) + abs(target[1]) for gx, gy in ghosts: ghost_dist = abs(gx - target[0]) + abs(gy - target[1]) if ghost_dist <= player_dist: return False return True