In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the i-th domino. (A domino is a tile with two numbers from 1 to 6 - one on each half of the tile.) We may rotate the i-th domino, so that A[i] and B[i] swap values. Return th…
public class Solution { public int MinDominoRotations(int[] A, int[] B) { var na = A.Length; var nb = B.Length; if (na != nb) { ; } var dic1 = new Dictionary<int, List<int>>(); var dic2 = new Dictionary<int, List<int>>(); ; i <=…