python simple
python\nclass Solution:\n    def minDominoRotations(self, tops: List[int], bottoms: List[int]) -> int:\n        counter = Counter(tops + bottoms)\n        val, 
```python\nclass Solution:\n    def minDominoRotations(self, tops: List[int], bottoms: List[int]) -> int:\n        counter = Counter(tops + bottoms)\n        val, count = counter.most_common(1)[0]\n        if count < len(tops):\n            return -1\n        if tops.count(val) < bottoms.count(val):\n            tops, bottoms = bottoms, tops\n        swap_count = 0\n        for i in range(len(tops)):\n            if tops[i] == val:\n                continue\n            if bottoms[i] == val:\n                swap_count += 1\n                continue\n            return -1\n        return min(swap_count, len(tops) - swap_count)\n```
['Python']