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

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

leetcode1304. Find N Unique Integers Sum up to Zero

2022-03-02 13:52 作者:您是打尖兒還是住店呢  | 我要投稿

Given an integer?n, return?any?array containing?n?unique?integers such that they add up to?0.

?

Example 1:

Input: n = 5Output: [-7,-1,1,3,4]Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].

Example 2:

Input: n = 3Output: [-1,0,1]

Example 3:

Input: n = 1Output: [0]

?

Constraints:

  • 1 <= n <= 1000



這次有點(diǎn)快,有點(diǎn)不可思議,主要是看這個(gè)數(shù)據(jù)是奇數(shù)項(xiàng)還是偶數(shù)項(xiàng);

Runtime:?0 ms, faster than?100.00%?of?Java?online submissions for?Find N Unique Integers Sum up to Zero.

Memory Usage:?42.8 MB, less than?6.64%?of?Java?online submissions for?Find N Unique Integers Sum up to Zero.

Next challenges:


leetcode1304. Find N Unique Integers Sum up to Zero的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
宁强县| 克什克腾旗| 余姚市| 沙田区| 和龙市| 泸西县| 合肥市| 罗定市| 白河县| 增城市| 星子县| 西林县| 新乡市| 江都市| 朝阳区| 岫岩| 靖边县| 武隆县| 上饶市| 仙居县| 天祝| 焦作市| 古交市| 东兰县| 平潭县| 洪洞县| 大同县| 盐边县| 额尔古纳市| 湘潭市| 山东省| 石阡县| 平顺县| 望江县| 白玉县| 平泉县| 万盛区| 江城| 寻甸| 玉环县| 辰溪县|