style: enable MethodName in CheckStyle (#5182)

enabled: MethodName in CheckStyle
This commit is contained in:
Godwill Christopher
2024-05-27 01:06:06 -06:00
committed by GitHub
parent ea4dc15a24
commit 295e7436b1
53 changed files with 225 additions and 225 deletions

View File

@ -12,12 +12,12 @@ public class PowerSum {
private int sum = 0;
public int powSum(int N, int X) {
Sum(N, X, 1);
sum(N, X, 1);
return count;
}
// here i is the natural number which will be raised by X and added in sum.
public void Sum(int N, int X, int i) {
public void sum(int N, int X, int i) {
// if sum is equal to N that is one of our answer and count is increased.
if (sum == N) {
count++;
@ -26,7 +26,7 @@ public class PowerSum {
// result is less than N.
else if (sum + power(i, X) <= N) {
sum += power(i, X);
Sum(N, X, i + 1);
sum(N, X, i + 1);
// backtracking and removing the number added last since no possible combination is
// there with it.
sum -= power(i, X);
@ -34,7 +34,7 @@ public class PowerSum {
if (power(i, X) < N) {
// calling the sum function with next natural number after backtracking if when it is
// raised to X is still less than X.
Sum(N, X, i + 1);
sum(N, X, i + 1);
}
}