@@ -0,0 +1,998 @@
+package leetcode;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * https://oj.leetcode.com/problems/roman-to-integer/%0A */%0Apublic class Problem13 %7B%0A    public int romanToInt(String s) %7B%0A        Map%3CCharacter, Integer%3E romans = new HashMap%3C%3E();%0A        romans.put('I', 1);%0A        romans.put('V', 5);%0A        romans.put('X', 10);%0A        romans.put('L', 50);%0A        romans.put('C', 100);%0A        romans.put('D', 500);%0A        romans.put('M', 1000);%0A        %0A        String upperCaseStr = s.toUpperCase();%0A        char%5B%5D chars = upperCaseStr.toCharArray();%0A        int result = 0;%0A        for (int i = 0; i %3C chars.length; i++) %7B%0A            if (i+1 == chars.length) %7B%0A                result += romans.get(chars%5Bi%5D);%0A                break;%0A            %7D%0A            if (romans.get(chars%5Bi%5D) %3E= romans.get(chars%5Bi+1%5D)) %7B%0A                result += romans.get(chars%5Bi%5D);%0A            %7D else %7B%0A                result -= romans.get(chars%5Bi%5D);%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

Solve problem 13