Merge Triplets to Form Target Triplet LeetCode solution in Python
1class Solution:2def mergeTriplets(self, triplets: List[List[int]], target: List[int]) -> bool:34a, b, c = 0, 0, 05for i, (x, y, z) in enumerate(triplets):6if not (x > target[0] or y > target[1] or z > target[2]):7a, b, c = max(a, x), max(b, y), max(c, z)89return [a, b, c] == target