[プログラマーLV 2]コレクション辞書
1.問題の説明
アクセント辞典
2.問題分析
キーは、指定されたアクセントを使用して重複を許可するシーケンスを作成し、ソートすることです.product/composition/permutationの違いを覚えておいてください.混同しないでください.
3.私の回答
アクセント辞典
2.問題分析
キーは、指定されたアクセントを使用して重複を許可するシーケンスを作成し、ソートすることです.product/composition/permutationの違いを覚えておいてください.混同しないでください.
3.私の回答
from itertools import product
def solution(word):
words = []
for i in range(1, 6):
words += [''.join(word) for word in list(product(['A', 'E', 'I', 'O', 'U'], repeat=i))]
words.sort()
return words.index(word) + 1
Reference
この問題について([プログラマーLV 2]コレクション辞書), 我々は、より多くの情報をここで見つけました https://velog.io/@j_aion/프로그래머스-LV2-모음사전テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol