Skip to content

Commit f1c3fe3

Browse files
committed
Runtime: 167 ms (Top 96.67%) | Memory: 72.6 MB (Top 50.00%)
1 parent 5586686 commit f1c3fe3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1+
// Runtime: 167 ms (Top 96.67%) | Memory: 72.6 MB (Top 50.00%)
12
var mergeTriplets = function(triplets, target) {
2-
3+
34
let fst = false, snd = false, thrd = false;
4-
5+
56
const [t1, t2, t3] = target;
6-
7+
78
for(let i = 0; i < triplets.length; i++) {
8-
9+
910
const [a, b, c] = triplets[i];
10-
11+
1112
if(a === t1 && b <= t2 && c <= t3) fst = true;
12-
13+
1314
if(b === t2 && a <= t1 && c <= t3) snd = true;
14-
15+
1516
if(c === t3 && a <= t1 && b <= t2) thrd = true;
16-
17+
1718
if(fst && snd && thrd) return true;
1819
}
1920
return false;
20-
};
21+
};

0 commit comments

Comments
 (0)