We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18c3723 commit 4c7209dCopy full SHA for 4c7209d
1899-Merge-Triplets-to-Form-Target-Triplet.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+ def mergeTriplets(self, triplets: List[List[int]], target: List[int]) -> bool:
3
+ good = set()
4
+
5
+ for t in triplets:
6
+ if t[0] > target[0] or t[1] > target[1] or t[2] > target[2]:
7
+ continue
8
+ for i, v in enumerate(t):
9
+ if v == target[i]:
10
+ good.add(i)
11
+ return len(good) == 3
0 commit comments