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

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

leetcode1207. Unique Number of Occurrences

2022-03-26 09:46 作者:您是打尖兒還是住店呢  | 我要投稿

Given an array of integers?arr, return?true?if the number of occurrences of each value in the array is?unique, or?false?otherwise.

?

Example 1:

Input: arr = [1,2,2,1,1,3]Output: trueExplanation:?The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences.

Example 2:

Input: arr = [1,2]Output: false

Example 3:

Input: arr = [-3,0,1,-3,1,1,1,-3,10,0]Output: true

?

Constraints:

  • 1 <= arr.length?<= 1000

  • -1000 <= arr[i] <= 1000


Runtime:?2 ms, faster than?82.86%?of?Java?online submissions for?Unique Number of Occurrences.

Memory Usage:?42.8 MB, less than?7.88%?of?Java?online submissions for?Unique Number of Occurrences.

map遍歷一遍,然后對(duì)value的大小判斷大于1就false;

leetcode1207. Unique Number of Occurrences的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
廊坊市| 桦南县| 牙克石市| 仙居县| 惠水县| 乡城县| 云林县| 罗山县| 南投市| 阿拉善右旗| 南川市| 仙桃市| 光泽县| 汤原县| 高雄县| 巍山| 巴林右旗| 丰城市| 棋牌| 合水县| 舒城县| 柘城县| 正蓝旗| 黔江区| 綦江县| 句容市| 昌图县| 胶州市| 大庆市| 平泉县| 越西县| 神木县| 岳西县| 呈贡县| 正定县| 萍乡市| 如东县| 江陵县| 舟山市| 根河市| 福清市|