mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 14:04:17 +08:00
style: enable NeedBraces
in checkstyle (#5227)
* enable style NeedBraces * style: enable NeedBraces in checkstyle --------- Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:

committed by
GitHub

parent
51fcc66345
commit
87b17e0571
@ -16,11 +16,15 @@ public final class KaprekarNumbers {
|
||||
// Provides a list of kaprekarNumber in a range
|
||||
public static List<Long> kaprekarNumberInRange(long start, long end) throws Exception {
|
||||
long n = end - start;
|
||||
if (n < 0) throw new Exception("Invalid range");
|
||||
if (n < 0) {
|
||||
throw new Exception("Invalid range");
|
||||
}
|
||||
ArrayList<Long> list = new ArrayList<>();
|
||||
|
||||
for (long i = start; i <= end; i++) {
|
||||
if (isKaprekarNumber(i)) list.add(i);
|
||||
if (isKaprekarNumber(i)) {
|
||||
list.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
|
Reference in New Issue
Block a user