mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-23 04:20:16 +08:00
style: enabled InnerAssignment
in checkstyle (#5162)
* style: enabled InnerAssignment in checkstyle * Refactor code formatting in KnapsackMemoization.java and UnionFind.java * style: remove redundant blank line * style: mark `includeCurrentItem` and `excludeCurrentItem` as `final` * style: remove `KnapsackMemoization` from `pmd-exclude.properties` * style: use `final` --------- Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
f8e62fbb90
commit
0f42e995a4
@ -15,7 +15,8 @@ public final class NewManShanksPrime {
|
||||
public static boolean nthManShanksPrime(int n, int expected_answer) {
|
||||
int[] a = new int[n + 1];
|
||||
// array of n+1 size is initialized
|
||||
a[0] = a[1] = 1;
|
||||
a[0] = 1;
|
||||
a[1] = 1;
|
||||
// The 0th and 1st index position values are fixed. They are initialized as 1
|
||||
for (int i = 2; i <= n; i++) {
|
||||
a[i] = 2 * a[i - 1] + a[i - 2];
|
||||
|
Reference in New Issue
Block a user