Skip to content

Commit e953ff8

Browse files
author
Max Base
authored
normalize()
1 parent 6e15a8a commit e953ff8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

main.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,22 @@ def nonSubscribers(subscriptions1, subscriptions2):
214214
if subscriptions2.count(subscription) == 0:
215215
results.append(subscription)
216216
return results
217+
218+
def normalize(g):
219+
results=[]
220+
for items in g:
221+
result=[]
222+
i=0
223+
added=0
224+
for item in items:
225+
if alphas.index(item[0]) != i+added:
226+
result.append(None)
227+
added=added+1
228+
result.append(item)
229+
i=i+1
230+
# Add none at end of list when your list size is 0 or 1 or 2
231+
# This will not run when your list size is 3
232+
for i in range(len(result), countChild):
233+
result.append(None)
234+
results.append(result)
235+
return results

0 commit comments

Comments
 (0)