public int romanToInt(String s) {
        int res = 0; 
        for(int i =0; i<s.length();i++)
        {
        	if(i<s.length()-1)
        	{
        		
        		String x  = s.substring(i, i+2);
        		switch (x){
        			case "CM": res += 900;i++; break; 
        			case "CD": res += 400;i++;break; 
        			case "XC": res += 90;i++;break; 
        			case "XL": res += 40;i++;break; 
        			case "IX": res += 9;i++;break; 
        			case "IV": res += 4;i++;break; 
        			default:
        				res += mapSingle(s.substring(i, i+1));  
        		}

        	}else
        		res += mapSingle(s.substring(i, i+1));
        		
        }
        return res;
    }