Algorithms/문제풀이
[LeetCode] Roman to Integer 풀이
문제 링크https://leetcode.com/problems/roman-to-integer/내 풀이시간복잡도O(N)공간복잡도O(1)import java.util.*;class Solution { public int romanToInt(String s) { int result = 0; Map map = new HashMap(); map.put("IV", 4); map.put("IX", 9); map.put("XL", 40); map.put("XC", 90); map.put("CD", 400); map.put("CM", 900); map.put("I", 1); map.put("..
2024. 9. 2. 01:00