Skip to content

Instantly share code, notes, and snippets.

@louy2
Last active June 26, 2016 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save louy2/a1758219f3623a893a3be06484691a03 to your computer and use it in GitHub Desktop.
Save louy2/a1758219f3623a893a3be06484691a03 to your computer and use it in GitHub Desktop.
Paiza POH 8 恋するハッカソン〜君色に染まるアイドル〜「水着」ゲットチャレンジ! https://paiza.jp/poh/hatsukoi/challenge/hatsukoi_special2
def needPanels(motoStr, atoStr):
panelDict = {}
motoList = list(motoStr)
for panel in motoList:
if panel in panelDict.keys():
panelDict[panel] += 1
else:
panelDict[panel] = 1
needCount = 0
atoList = list(atoStr)
for panel in atoList:
if panel in panelDict.keys():
if panelDict[panel] == 0:
needCount += 1
else:
panelDict[panel] -= 1
else:
needCount += 1
return needCount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment