Skip to content

Commit ebcebc4

Browse files
committed
Runtime: 31 ms (Top 67.39%) | Memory: 49 MB (Top 10.87%)
1 parent 199eb58 commit ebcebc4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/V/Verbal Arithmetic Puzzle/Verbal Arithmetic Puzzle.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 31 ms (Top 67.39%) | Memory: 49 MB (Top 10.87%)
12
class Solution {
23
public boolean isSolvable(String[] words, String result) {
34
boolean[] l = new boolean[26]; // init for all info here in this huge block
@@ -28,7 +29,7 @@ public boolean isSolvable(String[] words, String result) {
2829
}
2930

3031
private boolean solve(int idx, int carry, boolean[] l, List<Integer>[] d, int[] r, int[] a, int[] b){
31-
if (idx == -1){ // this function indicates that we are done with a list, moving onto the next list
32+
if (idx == -1){ // this function indicates that we are done with a list, moving onto the next list
3233
return r.length>d.length? carry > 0 &&
3334
ok(carry, r[0], a, b) : carry == 0;
3435
}
@@ -75,6 +76,6 @@ private boolean solveD(int cur, int idx, int carry, boolean[] l, List<Integer>[]
7576

7677
private boolean ok(int d, int c, int[] a, int[] b){ // check if there is a conflict.
7778
return a[c] == -1 && b[d] == -1
78-
|| a[c] == d && b[d] == c;
79+
|| a[c] == d && b[d] == c;
7980
}
80-
}
81+
}

0 commit comments

Comments
 (0)