Created
June 11, 2020 20:43
-
-
Save theboreddev/a598b252072e4855406aabea2a96fdd2 to your computer and use it in GitHub Desktop.
romanNumeralsRefactored
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
public class RomanNumerals { | |
private static final Map<Integer, String> ROMAN_NUMERALS = Map.of( | |
1, "I", | |
5, "V", | |
10, "X", | |
50, "L", | |
100, "C", | |
500, "D", | |
1000, "M" | |
); | |
public static String convert(int number) { | |
return ROMAN_NUMERALS.get(number); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment