mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
style: enable MultipleVariableDeclarations in checkstyle (#5175)
Co-authored-by: vaibhav <vaibhav.waghmare@techprescient.com>
This commit is contained in:
@@ -10,7 +10,8 @@ public final class EggDropping {
|
||||
// min trials with n eggs and m floors
|
||||
public static int minTrials(int n, int m) {
|
||||
int[][] eggFloor = new int[n + 1][m + 1];
|
||||
int result, x;
|
||||
int result;
|
||||
int x;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
eggFloor[i][0] = 0; // Zero trial for zero floor.
|
||||
@@ -41,7 +42,8 @@ public final class EggDropping {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int n = 2, m = 4;
|
||||
int n = 2;
|
||||
int m = 4;
|
||||
// result outputs min no. of trials in worst case for n eggs and m floors
|
||||
int result = minTrials(n, m);
|
||||
System.out.println(result);
|
||||
|
||||
Reference in New Issue
Block a user