Skip to content

Commit

Permalink
Revert "Update Challenge.java (#117)"
Browse files Browse the repository at this point in the history
This reverts acbf332.
  • Loading branch information
ByteLegendBot committed Nov 23, 2023
1 parent acbf332 commit 0c79396
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/main/java/com/bytelegend/Challenge.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ public static void main(String[] args) {
* <p>If there is no root, return an empty array.
*/
public static double[] calculate(int a, int b, int c) {
double delta = b * b - 4 * a * c;
if (delta < 0) {
return new double[] {};
} else if (delta == 0) {
double root = -b / (2.0 * a);
return new double[] {root};
} else {
double root1 = (-b + Math.sqrt(delta)) / (2.0 * a);
double root2 = (-b - Math.sqrt(delta)) / (2.0 * a);
return new double[] {root1, root2};
}
return null;
}
}

0 comments on commit 0c79396

Please sign in to comment.