五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

LeetCode2225. Find Players With Zero or One Losses

2022-11-28 17:40 作者:您是打尖兒還是住店呢  | 我要投稿


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 testcases 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.


目前暫時(shí)不要求別的,能過就行,這個(gè)是比較簡單是,使用ArrayList即可,

將對(duì)應(yīng)的隊(duì)伍篩選出來即可,包括set,在用collections排序一下就行。

Runtime:?204 ms, faster than?61.77%?of?Java?online submissions for?Find Players With Zero or One Losses.

Memory Usage:?168.4 MB, less than?23.65%?of?Java?online submissions for?Find Players With Zero or One Losses.


LeetCode2225. Find Players With Zero or One Losses的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
惠来县| 白银市| 东乌| 德令哈市| 宁海县| 抚顺市| 巴塘县| 炉霍县| 连南| 旬阳县| 辉南县| 丽江市| 大埔区| 遵义市| 周宁县| 敦煌市| 大庆市| 五河县| 巫山县| 青神县| 廊坊市| 岑溪市| 永吉县| 赤峰市| 昭通市| 霍林郭勒市| 辽阳市| 武隆县| 乐业县| 大安市| 同心县| 南平市| 桐柏县| 陈巴尔虎旗| 葵青区| 福州市| 丹东市| 五台县| 舞钢市| 通城县| 永定县|