无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
曲靖市| 来凤县| 龙游县| 甘谷县| 阳城县| 尼木县| 馆陶县| 加查县| 衡阳市| 万源市| 巴林右旗| 新沂市| 中山市| 肃北| 光山县| 从江县| 泰来县| 福建省| 南郑县| 区。| 秀山| 南陵县| 缙云县| 嘉禾县| 资源县| 梓潼县| 资阳市| 望城县| 肃南| 九寨沟县| 凤台县| 盐边县| 余干县| 凤城市| 独山县| 出国| 明星| 什邡市| 尉犁县| 海晏县| 霍林郭勒市|