-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path047_sumZero.py
More file actions
30 lines (29 loc) · 855 Bytes
/
047_sumZero.py
File metadata and controls
30 lines (29 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
class Solution:
def sumZero(self, n: int) -> List[int]:
# result=[]
# _int_=-n+1
# for i in range(n):
# result.append(_int_)
# _int_=_int_+2
# return result
# list0 = [0]
# list_1 = []
# list1 = []
# i=0
# if n == 1 :
# return list0
# else:
# lhs = (n//2)
# i=1
# while i in range(lhs+1):
# list1.append(i)
# i+=1
# for i in range(len(list1)):
# list_1.append(list1[i]*-1)
# list_1 = sorted(list_1, reverse=True)
# if n%2 != 0:
# list_1.extend(list0)
# list_1.extend(list1)
# else:
# list_1.extend(list1)
# return list_1