Python in 2 lines
\nclass Solution:\n    def minDominoRotations(self, tops: List[int], bottoms: List[int]) -> int:\n        v = list(reduce(operator.and_, (set(x) for x in zip(to
```\nclass Solution:\n    def minDominoRotations(self, tops: List[int], bottoms: List[int]) -> int:\n        v = list(reduce(operator.and_, (set(x) for x in zip(tops, bottoms))))\n        return -1 if not v else len(tops) - max(tops.count(v[0]), bottoms.count(v[0]))\n```
[]