Remove unnecessary code (#4141)

This commit is contained in:
Saurabh Rahate
2023-04-03 20:05:59 +05:30
committed by GitHub
parent 805f09850c
commit ad72c28d91
64 changed files with 125 additions and 322 deletions

View File

@ -27,7 +27,7 @@ class Solution {
String maxStr = "";
for (int i = 0; i < n; ++i) {
for (int j = i; j < n; ++j) {
if (isValid(s, i, j) == true) {
if (isValid(s, i, j)) {
if (j - i + 1 > maxStr.length()) { // update maxStr
maxStr = s.substring(i, j + 1);
}

View File

@ -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;
}