JS
\n/**\n * @param {number} n_rows\n * @param {number} n_cols\n */\nvar Solution = function(n_rows, n_cols) {\n    this.n_rows = n_rows;\n    this.n_cols = n_cols
```\n/**\n * @param {number} n_rows\n * @param {number} n_cols\n */\nvar Solution = function(n_rows, n_cols) {\n    this.n_rows = n_rows;\n    this.n_cols = n_cols;\n    this.log = [];\n};\n\n/**\n * @return {number[]}\n */\nSolution.prototype.flip = function() {\n    function randomInteger(min, max) {\n        return Math.floor(Math.random() * (max - min + 1)) + min;\n    }\n    \n    const findInLog = (row, col) => {\n        let coor = [row, col];\n        for(let i = 0; i < this.log.length; i++) {\n            if (this.log[i][0] === coor[0] && this.log[i][1] === coor[1]) return true;\n        }\n        \n        return false;\n    }\n    \n    \n    let randomRow = randomInteger(0, this.n_rows - 1);\n    let randomCol = randomInteger(0, this.n_cols - 1);\n    \n    while(findInLog(randomRow, randomCol) !== false) {\n        randomRow = randomInteger(0, this.n_rows - 1);\n        randomCol = randomInteger(0, this.n_cols - 1);\n    }\n                          \n    this.log.push([randomRow, randomCol]);\n    \n    return [randomRow, randomCol];\n};\n\n/**\n * @return {void}\n */\nSolution.prototype.reset = function() {\n    this.log = [];\n};\n\n/** \n * Your Solution object will be instantiated and called as such:\n * var obj = new Solution(n_rows, n_cols)\n * var param_1 = obj.flip()\n * obj.reset()\n */\n```
[]