最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

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

Leetcode 1512 Number of Good Pairs

2022-02-06 14:28 作者:您是打尖兒還是住店呢  | 我要投稿

Given an array of integers?nums, return?the number of?good pairs.

A pair?(i, j)?is called?good?if?nums[i] == nums[j]?and?i?<?j.

?

Example 1:

Input: nums = [1,2,3,1,1,3]Output: 4Explanation: There are 4 good pairs (0,3), (0,4), (3,4), (2,5) 0-indexed.

Example 2:

Input: nums = [1,1,1,1]Output: 6Explanation: Each pair in the array are good.



Runtime:?1 ms, faster than?81.21%?of?Java?online submissions for?Number of Good Pairs.

Memory Usage:?39.7 MB, less than?14.56%?of?Java?online submissions for?Number of Good Pairs.

整體表現(xiàn)不太好。只能說一般。

Leetcode 1512 Number of Good Pairs的評論 (共 條)

分享到微博請遵守國家法律
江北区| 巴马| 新龙县| 淮滨县| 绥德县| 桐庐县| 西昌市| 双峰县| 砚山县| 邢台市| 从化市| 定日县| 遂昌县| 平和县| 铜梁县| 永昌县| 隆德县| 大埔区| 唐山市| 齐齐哈尔市| 兴仁县| 荣昌县| 石柱| 清涧县| 开鲁县| 鄂温| 台中市| 青神县| 增城市| 泌阳县| 石城县| 兰西县| 石楼县| 会理县| 三原县| 古田县| 桐城市| 两当县| 宜城市| 元江| 武鸣县|