You are given a team and an integer dist. A value of team[i] == 1 indicates that the person at index i is “it”, while a value of team[i] == 0 indicates that the person is not “it”.
A person who is “it” at index i can catch at most one person at index j if team[j] == 0 and dist. Each person who is not “it” can be caught by at most one person.
Return the maximum number of people that can be caught.
Constraints:
team.length
team[i]
dist team.length
You are given a team and an integer dist. A value of team[i] == 1 indicates that the person at index i is “it”, while a value of team[i] == 0 indicates that the person is not “it”.
A person who is “it” at index i can catch at most one person at index j if team[j] == 0 and dist. Each person who is not “it” can be caught by at most one person.
Return the maximum number of people that can be caught.
Constraints:
team.length
team[i]
dist team.length