(int lastDigit, int currentDigit, char condition)
| 32 | } |
| 33 | |
| 34 | private boolean isValid(int lastDigit, int currentDigit, char condition) { |
| 35 | return (condition == 'I' && lastDigit < currentDigit) || (condition == 'D' && lastDigit > currentDigit); |
| 36 | } |
| 37 | } |