mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
Remove unnecessary code (#4141)
This commit is contained in:
@@ -72,13 +72,8 @@ public static int myAtoi(String s) {
|
||||
if (db1 > (2147483647)) {
|
||||
return 2147483647;
|
||||
}
|
||||
}else if (number.length() == 10 && negative) {
|
||||
double db1 = Double.parseDouble(number);
|
||||
if (db1 >= 2147483648d) {
|
||||
return -2147483648;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(negative){
|
||||
return Integer.parseInt(number)*-1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user