mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-21 11:10:08 +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
@ -52,10 +52,11 @@ public final class PascalTriangle {
|
||||
*/
|
||||
for (int i = 0; i <= line; i++) {
|
||||
// First and last values in every row are 1
|
||||
if (line == i || i == 0) arr[line][i] = 1;
|
||||
// The rest elements are sum of values just above and left of above
|
||||
else
|
||||
if (line == i || i == 0) {
|
||||
arr[line][i] = 1;
|
||||
} else {
|
||||
arr[line][i] = arr[line - 1][i - 1] + arr[line - 1][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user