C++ EASY|| CLEAN
\'\'\'\nclass Solution {\npublic:\n    int minDominoRotations(vector& tops, vector& bottoms) \n    {\n        int n=tops.size();\n        \n\t\t//count the numb
\'\'\'\nclass Solution {\npublic:\n    int minDominoRotations(vector<int>& tops, vector<int>& bottoms) \n    {\n        int n=tops.size();\n        \n\t\t//count the numbers which comes in tops and bottoms separately\n        vector<int>v1(6,0),v2(6,0);\n        \n        for(int i=0;i<n;i++)\n        {\n            v1[tops[i]-1]++;\n            v2[bottoms[i]-1]++;\n        }\n        \n        vector<int>v;\n        \n        for(int i=0;i<6;i++)\n        {\n\t\t//as the max number can be 6 so if we have suffiecient sum of a particular \n\t\t//then only there is chance to make domino rotation\n            if(v1[i]+v2[i]>=n)\n                v.push_back(i);\n        }\n        \n        int q=v.size(),m=INT_MAX;\n        \n        if(q==0)\n            return -1;\n        \n        for(int i=0;i<q;i++)\n        {\n            \n            int m1=0,m2=0;\n            \n            for(int j=0;j<n;j++)\n            {\n                \n                if(tops[j]!=(v[i]+1) && bottoms[j]==(v[i]+1))\n                {\n                    m1++;\n                }\n                else if(bottoms[j]!=(v[i]+1) && tops[j]==(v[i]+1))\n                {\n                    m2++;\n                }\n                \n            }\n            // if we have exact sum of rotaton eqaul to the length of tops then only it is possible \n            if(m1+v1[v[i]]==n && m1<m)\n                m=m1;\n            if(m2+v2[v[i]]==n && m2<m)\n                m=m2;\n            \n        }\n        \n        if(m!=INT_MAX)\n            return m;\n        //if we dont get the moves then return -1\n        return -1;\n    }\n};\n\'\'\'
['C']