Stuart Kent 9 лет назад
Родитель
Сommit
2cc2d71722
1 измененных файлов: 1 добавлений и 1 удалений
  1. 1
    1
      exercises/luhn/src/example/java/LuhnValidator.java

+ 1
- 1
exercises/luhn/src/example/java/LuhnValidator.java Просмотреть файл

15
         final List<Integer> computedDigits = new ArrayList<>();
15
         final List<Integer> computedDigits = new ArrayList<>();
16
 
16
 
17
         for (int charIndex = 0; charIndex < reversedSanitizedCandidate.length(); charIndex++) {
17
         for (int charIndex = 0; charIndex < reversedSanitizedCandidate.length(); charIndex++) {
18
-            int inputDigit = Character.digit(sanitizedCandidate.charAt(charIndex), 10);
18
+            int inputDigit = Character.digit(reversedSanitizedCandidate.charAt(charIndex), 10);
19
 
19
 
20
             /*
20
             /*
21
              * Character.digit returns a negative int if the supplied character does not represent a digit with respect
21
              * Character.digit returns a negative int if the supplied character does not represent a digit with respect