Expected 1056 but I got 1084
\nclass Solution:\n    def minDominoRotations(self, A: List[int], B: List[int]) -> int:\n        def Switch(A,B):\n            \n            Master = A.copy(); 
```\nclass Solution:\n    def minDominoRotations(self, A: List[int], B: List[int]) -> int:\n        def Switch(A,B):\n            \n            Master = A.copy(); Slave = B.copy();\n            Count = 0;\n            for i in range(len(Master)-1):\n                if(Master[i] != Master[i+1]):\n                    if(Master[i] != Slave[i+1]): \n                        return -1\n                    Master[i+1] = Slave[i+1]\n                    Count += 1\n            return Count\n        \n        Switch_A = Switch(A,B)\n        Switch_B = Switch(B,A)\n        \n        if(Switch_A == -1 and Switch_B == -1): return -1\n        elif(Switch_A == -1 and Switch_B >= 0): return Switch_B\n        elif(Switch_B == -1 and Switch_A >= 0): return Switch_A\n        \n        return Switch_B\n```\n\nHere is my python code. The main idea for my code is to make A and B playing master once and using the other list filling the master. \nHowever, I got 1084 for the test case but that case required 1056 as the result.\nI can not figure out the problem.
[]