You are given three integer arrays robots, distance, and walls, all representing positions on a
There are robots[i] and has a maximum firing range of distance[i]. Each robot can choose to fire a laser beam either to the left or to the right:
If robot
If robot
A laser beam cannot pass through another robot. Any wall located within the covered range of a laser beam is destroyed.
Return the maximum number of unique walls that can be destroyed if each robot independently chooses to fire either to the left or to the right.
Constraints:
robots.length distance.length
walls.length
robots[i], walls[j]
distance[i]
All values in robots are unique.
All values in walls are unique.
You are given three integer arrays robots, distance, and walls, all representing positions on a
There are robots[i] and has a maximum firing range of distance[i]. Each robot can choose to fire a laser beam either to the left or to the right:
If robot
If robot
A laser beam cannot pass through another robot. Any wall located within the covered range of a laser beam is destroyed.
Return the maximum number of unique walls that can be destroyed if each robot independently chooses to fire either to the left or to the right.
Constraints:
robots.length distance.length
walls.length
robots[i], walls[j]
distance[i]
All values in robots are unique.
All values in walls are unique.