Skip to content

Instantly share code, notes, and snippets.

@theboreddev
Created June 11, 2020 20:43
Show Gist options
  • Save theboreddev/a598b252072e4855406aabea2a96fdd2 to your computer and use it in GitHub Desktop.
Save theboreddev/a598b252072e4855406aabea2a96fdd2 to your computer and use it in GitHub Desktop.
romanNumeralsRefactored
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