Skip to content

Commit 1fb93a6

Browse files
committed
Runtime: 125 ms (Top 32.14%) | Memory: 42.9 MB (Top 73.21%)
1 parent b7a4860 commit 1fb93a6

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 125 ms (Top 32.14%) | Memory: 42.9 MB (Top 73.21%)
12
/**
23
* @param {string} start
34
* @param {string} end
@@ -6,30 +7,30 @@
67
var canTransform = function(start, end) {
78
let i = 0;
89
let j = 0;
9-
10+
1011
while (i < start.length || j < end.length) {
1112
if (start[i] === 'X') {
1213
i++;
1314
continue;
1415
}
15-
16+
1617
if (end[j] === 'X') {
1718
j++;
1819
continue;
1920
}
20-
21-
// Breaking (1)
21+
22+
// Breaking (1)
2223
if (start[i] !== end[j]) return false;
23-
24-
// Breaking (2)
24+
25+
// Breaking (2)
2526
if (start[i] === 'R' && i > j) return false;
26-
27-
// Breaking (3)
27+
28+
// Breaking (3)
2829
if (start[i] === 'L' && j > i) return false;
29-
30+
3031
i++;
3132
j++;
3233
}
33-
34+
3435
return true;
35-
};
36+
};

0 commit comments

Comments
 (0)