国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

leetcode 1394. Find Lucky Integer in an Array

2022-02-10 18:26 作者:您是打尖兒還是住店呢  | 我要投稿

Given an array of integers?arr, a?lucky integer?is an integer that has a frequency in the array equal to its value.

Return?the largest?lucky integer?in the array. If there is no?lucky integer?return?-1.

?

Example 1:

Input: arr = [2,2,3,4]Output: 2Explanation: The only lucky number in the array is 2 because frequency[2] == 2.

Example 2:

Input: arr = [1,2,2,3,3,3]Output: 3Explanation: 1, 2 and 3 are all lucky numbers, return the largest of them.

Example 3:

Input: arr = [2,2,2,3,3]Output: -1Explanation: There are no lucky numbers in the array.




Runtime:?10 ms, faster than?13.49%?of?Java?online submissions for?Find Lucky Integer in an Array.

Memory Usage:?43.6 MB, less than?11.76%?of?Java?online submissions for?Find Lucky Integer in an Array.


leetcode 1394. Find Lucky Integer in an Array的評論 (共 條)

分享到微博請遵守國家法律
汉沽区| 南华县| 汕头市| 东乌珠穆沁旗| 芦溪县| 华阴市| 梁山县| 余姚市| 霸州市| 尉犁县| 渝中区| 武胜县| 信丰县| 本溪| 海阳市| 大兴区| 雷州市| 呼和浩特市| 曲松县| 徐汇区| 诏安县| 库车县| 德清县| 玉溪市| 正蓝旗| 松滋市| 镇原县| 麻阳| 抚松县| 茌平县| 西乡县| 武乡县| 宁国市| 恩平市| 醴陵市| 甘泉县| 深水埗区| 鞍山市| 鸡东县| 进贤县| 虞城县|