0%

剑指offer-20

题目

结果

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
class Solution {
public boolean isNumber(String s) {
try {
if (s.endsWith("f") || s.endsWith("D")) {
return false;
}
Double.parseDouble(s);
return true;
} catch (NumberFormatException e) {
return false;
}
}
}

复杂度

idk