Merge Triplets to Form Target Triplet LeetCode solution in Python

1
class Solution:
2
def mergeTriplets(self, triplets: List[List[int]], target: List[int]) -> bool:
3

4
a, b, c = 0, 0, 0
5
for i, (x, y, z) in enumerate(triplets):
6
if not (x > target[0] or y > target[1] or z > target[2]):
7
a, b, c = max(a, x), max(b, y), max(c, z)
8

9
return [a, b, c] == target

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0