File tree 2 files changed +18
-18
lines changed
solution/3400-3499/3470.Permutations IV
2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -117,18 +117,18 @@ import heapq
117
117
118
118
class Solution :
119
119
def permute (self , xxy : int , yyz : int ) -> List[int ]:
120
-
121
- kasu = {}
120
+
121
+ kasu = {}
122
122
nnss = []
123
123
majs = []
124
124
ajwi = heapq.heappush
125
125
laoq = []
126
-
126
+
127
127
zzp = [i for i in range (1 , xxy + 1 ) if i % 2 == 1 ]
128
128
zzq = [i for i in range (1 , xxy + 1 ) if i % 2 == 0 ]
129
129
130
130
ppp = []
131
- nxr = None
131
+ nxr = None
132
132
133
133
for pps in range (xxy):
134
134
if pps == 0 :
@@ -139,11 +139,11 @@ class Solution:
139
139
fff = False
140
140
for cndt in cnd:
141
141
if cndt % 2 == 1 :
142
- nxt = 0
142
+ nxt = 0
143
143
noo = len (zzp) - 1
144
144
nee = len (zzq)
145
145
else :
146
- nxt = 1
146
+ nxt = 1
147
147
noo = len (zzp)
148
148
nee = len (zzq) - 1
149
149
@@ -164,7 +164,7 @@ class Solution:
164
164
165
165
ajwi(nnss, cnt)
166
166
ajwi(majs, llq)
167
-
167
+
168
168
if cnt >= yyz:
169
169
ppp.append(cndt)
170
170
if cndt % 2 == 1 :
@@ -177,9 +177,9 @@ class Solution:
177
177
break
178
178
else :
179
179
yyz -= cnt
180
-
180
+
181
181
ajwi(laoq, len (ppp))
182
-
182
+
183
183
if not fff:
184
184
return []
185
185
return ppp
Original file line number Diff line number Diff line change @@ -114,18 +114,18 @@ import heapq
114
114
115
115
class Solution :
116
116
def permute (self , xxy : int , yyz : int ) -> List[int ]:
117
-
118
- kasu = {}
117
+
118
+ kasu = {}
119
119
nnss = []
120
120
majs = []
121
121
ajwi = heapq.heappush
122
122
laoq = []
123
-
123
+
124
124
zzp = [i for i in range (1 , xxy + 1 ) if i % 2 == 1 ]
125
125
zzq = [i for i in range (1 , xxy + 1 ) if i % 2 == 0 ]
126
126
127
127
ppp = []
128
- nxr = None
128
+ nxr = None
129
129
130
130
for pps in range (xxy):
131
131
if pps == 0 :
@@ -136,11 +136,11 @@ class Solution:
136
136
fff = False
137
137
for cndt in cnd:
138
138
if cndt % 2 == 1 :
139
- nxt = 0
139
+ nxt = 0
140
140
noo = len (zzp) - 1
141
141
nee = len (zzq)
142
142
else :
143
- nxt = 1
143
+ nxt = 1
144
144
noo = len (zzp)
145
145
nee = len (zzq) - 1
146
146
@@ -161,7 +161,7 @@ class Solution:
161
161
162
162
ajwi(nnss, cnt)
163
163
ajwi(majs, llq)
164
-
164
+
165
165
if cnt >= yyz:
166
166
ppp.append(cndt)
167
167
if cndt % 2 == 1 :
@@ -174,9 +174,9 @@ class Solution:
174
174
break
175
175
else :
176
176
yyz -= cnt
177
-
177
+
178
178
ajwi(laoq, len (ppp))
179
-
179
+
180
180
if not fff:
181
181
return []
182
182
return ppp
You can’t perform that action at this time.
0 commit comments