国产精品天干天干,亚洲毛片在线,日韩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的評論 (共 條)

分享到微博請遵守國家法律
五常市| 吉隆县| 三穗县| 黔西县| 阜新| 孟村| 汉寿县| 贵溪市| 分宜县| 积石山| 保德县| 东平县| 宁阳县| 丰都县| 柯坪县| 和平区| 庄河市| 威海市| 蕉岭县| 阜宁县| 五寨县| 张家口市| 开江县| 安徽省| 芷江| 中阳县| 揭西县| 武山县| 睢宁县| 南通市| 邯郸市| 周口市| 射洪县| 栖霞市| 吉水县| 勐海县| 霍邱县| 阜新| 克山县| 东明县| 上虞市|