1989. Maximum Number of People That Can Be Caught in Tag
Description
**Input:** team = [0,1,0,1,0], dist = 3
**Output:** 2
**Explanation:**
The person who is "it" at index 1 can catch people in the range [i-dist, i+dist] = [1-3, 1+3] = [-2, 4].
They can catch the person who is not "it" at index 2.
The person who is "it" at index 3 can catch people in the range [i-dist, i+dist] = [3-3, 3+3] = [0, 6].
They can catch the person who is not "it" at index 0.
The person who is not "it" at index 4 will not be caught because the people at indices 1 and 3 are already catching one person.**Input:** team = [1], dist = 1
**Output:** 0
**Explanation:**
There are no people who are not "it" to catch.ac
Last updated