LeetCode 1820. Maximum Number of Accepted Invitations
There are m
boys and n
girls in a class attending an upcoming party.
You are given an m x n
integer matrix grid
, where grid[i][j]
equals 0
or 1
. If grid[i][j] == 1
, then that means the ith
boy can invite the jth
girl to the party. A boy can invite at most one girl, and a girl can accept at most one invitation from a boy.
Return the maximum possible number of accepted invitations.
Example 1:
Example 2:
Constraints:
grid.length == m
grid[i].length == n
1 <= m, n <= 200
grid[i][j]
is either0
or1
.
Solution
PreviousLeetCode 1819. Number of Different Subsequences GCDsNextLeetCode 1822. Sign of the Product of an Array
Last updated