You are given a 2D integer array
drones, wheredrones[i] = [x_i, y_i, range_i]represents the x-coordinate, y-coordinate, and travel range of thei^thdrone.You are also given an integer array
target = [tx, ty], representing the coordinates of the target.A drone
drones[i]can reach the target if the Manhattan distance between its coordinates and the target coordinates is less than or equal to itsrange_i.Return the index of the reachable drone with the minimum Manhattan distance to the target. If there is a tie, return the smallest index. If no drone can reach the target, return
-1.
1 | class Solution { |