Java Self Explanatory 99% faster
\nclass Solution {\n    public int minDominoRotations(int[] tops, int[] bottoms) {\n        int t = find(tops,bottoms,tops[0]);\n        int b = find(tops,botto
```\nclass Solution {\n    public int minDominoRotations(int[] tops, int[] bottoms) {\n        int t = find(tops,bottoms,tops[0]);\n        int b = find(tops,bottoms,bottoms[0]);\n        if(t < 0) return b;\n        if(b < 0) return t;\n        return Math.min(t,b);\n    }\n    public int find(int[] tops, int[] bottoms, int num) {\n        int top=0,bottom=0;\n        for(int i=0;i<tops.length;i++){\n            if(tops[i] != num  && bottoms[i] != num) return -1;\n            \n            if(tops[i] != num) top++;\n            if(bottoms[i] != num) bottom++;\n        }\n        return Math.min(top,bottom);\n    }\n}\n```
['Java']