JavaScript ||Easy Beginner Friendly Solution || 99% faster || With Comments
\n/**\n * @param {number[]} tops\n * @param {number[]} bottoms\n * @return {number}\n */\nvar minDominoRotations = function(tops, bottoms) {\n    const targetTo
```\n/**\n * @param {number[]} tops\n * @param {number[]} bottoms\n * @return {number}\n */\nvar minDominoRotations = function(tops, bottoms) {\n    const targetTop = tops[0], targetBtm = bottoms[0]; //store values of the fisrt domino\n  for (const target of [targetTop, targetBtm]) {\n    let countTop = 0, countBtm = 0;\n    for (let i = 0; i < tops.length; i++) {\n      if (target !== tops[i] && target !== bottoms[i]) \n          break; \n      if (tops[i] !== target) \n          countTop++; // top value is not equal to target inc top rotation value \n      if (bottoms[i] !== target) \n          countBtm++;  bottom value is not equal to target inc bottom rotation value\n      if (i === tops.length - 1)  //at the end of the list return min rotation value\n          return Math.min(countTop, countBtm);\n    }\n  }\n  return -1;\n};\n```\n\n![image](https://assets.leetcode.com/users/images/39f1abc2-6c48-4ff7-80c3-95b1cfc39986_1647765633.5326955.png)\n\n\nPlease Do upvote if you find it helpful!! Cheers
['JavaScript']