/* (C) 2024 YourCompanyName */ package math; import java.util.HashMap; import java.util.Map; /** * Created by gouthamvidyapradhan on 12/08/2017. * *
Given a roman numeral, convert it to an integer. * *
Input is guaranteed to be within the range from 1 to 3999.
*/
public class RomanToInteger {
/**
* Main method
*
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
System.out.println(new RomanToInteger().romanToInt("DXCIX"));
}
public int romanToInt(String s) {
Map