Minor cleanup

master
E. Almqvist 4 years ago
parent b0d549bf91
commit 3cc098d39b
  1. 10
      2020/6.py

@ -41,24 +41,18 @@ def countQuestionsAll( group ):
if( person != "" and person != None ):
personsLen += 1
chars = toList(person)
print(person, "#", chars)
for char in chars:
if( char and char != "" ):
groupQs.append(char)
print("GRP", groupQs)
allQs = 0
seenQ = []
for q in groupQs:
num = groupQs.count(q)
print( "q:", q, "num", num, personsLen, end="" )
if(num == personsLen and not q in seenQ):
print(" valid")
seenQ.append(q)
allQs += 1
else:
print(" not valid")
print(allQs)
@ -77,4 +71,6 @@ for group in groups:
grpAll += num2
grpAllList.append(num2)
print("\n", grpCount, grpAll)
print("----")
print("Part1:", grpCount)
print("Part2:", grpAll)

Loading…
Cancel
Save