Super Dirty but intuitive solution😭😭😭😭
\n/**\n * @param {number[]} tops\n * @param {number[]} bottoms\n * @return {number}\n */\nvar minDominoRotations = function(tops, bottoms) {\n    function findM
```\n/**\n * @param {number[]} tops\n * @param {number[]} bottoms\n * @return {number}\n */\nvar minDominoRotations = function(tops, bottoms) {\n    function findMax(arr){\n        let maxFreq=-1;\n        let count=0;\n        for(let i=0;i<arr.length;i++){\n            if(count===0){\n                maxFreq=arr[i];\n                count=1;\n            }\n            else if(arr[i]===maxFreq)\n                count++;\n            else{\n                count--;\n            }\n\n        }\n        return maxFreq;\n    }\n    \n    let f1=findMax(tops);\n    let f2=findMax(bottoms);\n    let count1=0;\n    let count2=0;\n    for(let i=0;i<tops.length;i++){\n        if(tops[i]===f1)\n            continue;\n       else if(tops[i]!==f1 && bottoms[i]===f1)\n            count1++;\n        else\n            {\n                count1=-1;\n                break;\n            }\n    }\n    for(let i=0;i<bottoms.length;i++){\n        if(bottoms[i]===f2)\n            continue;\n        if(bottoms[i]!==f2 && tops[i]==f2){\n            count2++;\n            \n        }\n        else{\n            count2=-1;\n            break;\n        }\n    }\n    \n    if(count1===-1)\n        return count2;\n    if(count2===-1)\n        return count1;\n    return count1<count2?count1:count2;\n    \n    \n};\n```
[]