class Solution { public String intToRoman(int num) { String[][] r=new String[][]{{"","M","MM","MMM"}, {"","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"}, {"","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"}, {"","I","II","III","IV","V","VI","VII","VIII","IX"}}; return r[0][num/1000]+r[1][num%1000/100]+r[2][num%100/10]+r[3][num%10]; } }