auto commit

This commit is contained in:
CyC2018
2018-05-08 22:59:42 +08:00
parent 4c731d47bb
commit a4b1da0bd1
11 changed files with 383 additions and 152 deletions

View File

@ -2208,9 +2208,8 @@ Output : [0, 2]
```java
public List<Integer> diffWaysToCompute(String input) {
int n = input.length();
List<Integer> ways = new ArrayList<>();
for (int i = 0; i < n; i++) {
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
if (c == '+' || c == '-' || c == '*') {
List<Integer> left = diffWaysToCompute(input.substring(0, i));
@ -2232,9 +2231,10 @@ public List<Integer> diffWaysToCompute(String input) {
}
}
}
if (ways.size() == 0) {
if (ways.size() == 0)
ways.add(Integer.valueOf(input));
}
return ways;
}
```