Last active
June 26, 2016 11:43
-
-
Save louy2/a1758219f3623a893a3be06484691a03 to your computer and use it in GitHub Desktop.
Paiza POH 8 恋するハッカソン〜君色に染まるアイドル〜「水着」ゲットチャレンジ! https://paiza.jp/poh/hatsukoi/challenge/hatsukoi_special2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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