Python easy peasy // clear and simple 7 lines solution
\nclass Solution:\n    def minSwap(self, A, B):\n        non_swapped, swapped = [0] * len(A), [1] + [0] * (len(A) - 1)\n        for i in range(1, len(A)):\n    
```\nclass Solution:\n    def minSwap(self, A, B):\n        non_swapped, swapped = [0] * len(A), [1] + [0] * (len(A) - 1)\n        for i in range(1, len(A)):\n            swps, no_swps = set(), set()\n            if A[i - 1] < A[i] and B[i - 1] < B[i]: swps.add(swapped[i - 1] + 1 ); no_swps.add(non_swapped[i - 1])\n            if B[i - 1] < A[i] and A[i - 1] < B[i]: swps.add(non_swapped[i - 1] + 1); no_swps.add(swapped[i - 1])\n            swapped[i], non_swapped[i] = min(swps), min(no_swps)\n        return min(swapped[-1], non_swapped[-1])\n```
[]