Skip to content
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

Open
SonaVarshney opened this issue Jan 15, 2024 · 11 comments
Open

Day-19 q1: Find Players With Zero or One Losses #415

SonaVarshney opened this issue Jan 15, 2024 · 11 comments
Assignees

Comments

@SonaVarshney
Copy link
Contributor

Find Players With Zero or One Losses

You are given an integer array matches where matches[i] = [winneri, loseri] indicates that the player winneri defeated player loseri 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:

  • You should only consider the players that have played at least one match.
  • The test cases will be generated such that no two matches will have the same outcome.

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:

  • 1 <= matches.length <= 105
  • matches[i].length == 2
  • 1 <= winneri, loseri <= 105
  • winneri != loseri
  • All matches[i] are unique.
@SonaVarshney
Copy link
Contributor Author

@kratika-Jangid @karishma-2020 @bh-g please merge the Day-19 q1. Thanks :) #414

@Shubh-Krishna
Copy link
Contributor

please assign this question to me :) @bh-g

@Tech-neophyte
Copy link
Contributor

Hi! please assign this question to me.. @bh-g @kratika-Jangid

@avanimathur
Copy link
Contributor

Please assign it to me @bh-g @kratika-Jangid @karishma-2020

@namita0210
Copy link
Contributor

Please assign this issue to me - for a solution in java @bh-g

@deeptirajora
Copy link

please assign this question to me

@bh-g

@SonaVarshney
Copy link
Contributor Author

@karishma-2020 @kratika-Jangid @bh-g please merge. #429

@Shubhra-Narang
Copy link
Contributor

Please assign this issue to me

@priyagupta20044
Copy link
Contributor

Hi! please assign this question to me.. @bh-g

bh-g added a commit that referenced this issue Jan 23, 2024
@sriya-singh
Copy link

@bh-g @kratika-Jangid @karishma-2020 please assign this issue to me.

1 similar comment
@priyagupta20044
Copy link
Contributor

@bh-g @kratika-Jangid @karishma-2020 please assign this issue to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants