[Algorithm] Leetcode Roman to Integer

1 · Br · Nov. 25, 2021, midnight
Leetcode Roman to Integer https://leetcode.com/problems/roman-to-integer/ 1. 나의 풀이 class Solution { public int romanToInt(String s) { if (s.length() == 1) { return convertToint(s.charAt(0)); } int sum = 0; while (s.length() > 1) { if (isMinus(s.charAt(0), s.charAt(1))) { sum -= convertToint(s.charAt(0)); } else { sum += convertToint(s.charAt(0)); } s = s.substring(1); } sum += convertToint(s.charAt(0)); return sum; } private int convertToint(char ...