2410. Maximum Matching of Players With Trainers
On This Page
class Solution:
def matchPlayersAndTrainers(self, players: List[int], trainers: List[int]) -> int:
players.sort()
trainers.sort()
res = j = 0
for p in players:
while j < len(trainers) and trainers[j] < p:
j += 1
if j < len(trainers):
res += 1
j += 1
return res