[LeetCode/릿코드] 13. Roman to Integer
문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 class Solution { public int romanToInt(String s) { int answer = 0; int curr = 0; int prev = 0; for (int i = s.length() - 1; i >= 0; i--) { switch (s.charAt(i)) { case 'M': curr = 1000; break; case 'D': curr = 500; break; case 'C': curr = 100; break; case 'L': curr = 50; break; case 'X': curr = 10; break; case 'V': curr..