leetcode2sumc-leetcode-1304-Find-N-Unique-Integers-Sum-up-to-Zero:leetc

时间:2021-07-06 17:42:37
【文件属性】:
文件名称:leetcode2sumc-leetcode-1304-Find-N-Unique-Integers-Sum-up-to-Zero:leetc
文件大小:708B
文件格式:ZIP
更新时间:2021-07-06 17:42:37
系统开源 leetcode 2 和 c leetcode 1304 - 找到 N 个唯一整数总和为零 C# public int [] SumZero ( int n ) { var arr = new int [ n ]; int j = 0 ; int x = 1 ; for ( int i = 0 ; i < n / 2 ; i ++ ) { arr [ j ++ ] = x ; arr [ j ++ ] = - 1 * x ; x ++ ; } if ( n % 2 == 1 ) arr [ j ] = 0 ; return arr ; }
【文件预览】:
leetcode-1304-Find-N-Unique-Integers-Sum-up-to-Zero-master
----README.md(317B)

网友评论