LeetCode :Roman to Integer
문제
Example 1:
Input: s = “III”
Output: 3
Example 2:
Input: s = “IV”
Output: 4
Example 3:
Input: s = “IX”
Output: 9
Example 4:
Input: s = “LVIII”
Output: 58
Explanation: L = 50, V= 5, III = 3.
Example 5:
Input: s = “MCMXCIV”
Output: 1994
Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
잘못된 풀이(1차)
def solution(array, commands):
answer = []
temp = []
for i in range(3):
array[commands[i][0]-1:commands[i][1]].sort()
answer[i] = temp[commands[i][2]-1]
return answer
왜 틀렸는가?(1차)
반성일지(1차)
정답 풀이
핵심 알고리즘 및 스킬
다른 사람 풀이
댓글남기기