-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Day-19 q1: Find Players With Zero or One Losses #415
Comments
@kratika-Jangid @karishma-2020 @bh-g please merge the Day-19 q1. Thanks :) #414 |
please assign this question to me :) @bh-g |
Hi! please assign this question to me.. @bh-g @kratika-Jangid |
Please assign it to me @bh-g @kratika-Jangid @karishma-2020 |
Please assign this issue to me - for a solution in java @bh-g |
please assign this question to me |
@karishma-2020 @kratika-Jangid @bh-g please merge. #429 |
Please assign this issue to me |
Hi! please assign this question to me.. @bh-g |
@bh-g @kratika-Jangid @karishma-2020 please assign this issue to me. |
1 similar comment
@bh-g @kratika-Jangid @karishma-2020 please assign this issue to me. |
Find Players With Zero or One Losses
You are given an integer array
matches
wherematches[i] = [winneri, loseri]
indicates that the playerwinneri
defeated playerloseri
in a match.Return a list
answer
of size 2 where:answer[0]
is a list of all players that have not lost any matches.answer[1]
is a list of all players that have lost exactly one match.The values in the two lists should be returned in increasing order.
Note:
Example 1:
Input
: matches = [[1,3],[2,3],[3,6],[5,6],[5,7],[4,5],[4,8],[4,9],[10,4],[10,9]]Output
: [[1,2,10],[4,5,7,8]]Explanation
:Players 1, 2, and 10 have not lost any matches.
Players 4, 5, 7, and 8 each have lost one match.
Players 3, 6, and 9 each have lost two matches.
Thus, answer[0] = [1,2,10] and answer[1] = [4,5,7,8].
Example 2:
Input
: matches = [[2,3],[1,3],[5,4],[6,4]]Output
: [[1,2,5,6],[]]Explanation
:Players 1, 2, 5, and 6 have not lost any matches.
Players 3 and 4 each have lost two matches.
Thus, answer[0] = [1,2,5,6] and answer[1] = [].
Constraints:
The text was updated successfully, but these errors were encountered: