mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
style: enable ConstantName in checkstyle (#5139)
Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
This commit is contained in:
@@ -4,9 +4,7 @@ import java.util.*;
|
||||
|
||||
public class RomanToInteger {
|
||||
|
||||
private static final Map<Character, Integer> map = new HashMap<>() {
|
||||
private static final long serialVersionUID = 87605733047260530L;
|
||||
|
||||
private static final Map<Character, Integer> ROMAN_TO_INT = new HashMap<>() {
|
||||
{
|
||||
put('I', 1);
|
||||
put('V', 5);
|
||||
@@ -38,10 +36,10 @@ public class RomanToInteger {
|
||||
|
||||
if (prev != ' ') {
|
||||
// checking current Number greater then previous or not
|
||||
newPrev = map.get(prev) > newPrev ? map.get(prev) : newPrev;
|
||||
newPrev = ROMAN_TO_INT.get(prev) > newPrev ? ROMAN_TO_INT.get(prev) : newPrev;
|
||||
}
|
||||
|
||||
int currentNum = map.get(c);
|
||||
int currentNum = ROMAN_TO_INT.get(c);
|
||||
|
||||
// if current number greater then prev max previous then add
|
||||
if (currentNum >= newPrev) {
|
||||
|
||||
Reference in New Issue
Block a user