Go 4ms Solution
go\ntype Solution struct {\n\tnodes   [][2]int\n\thash    map[[2]int]bool\n\trow     int\n\tcol     int\n\tuseHash bool\n}\n\nfunc Constructor(n_rows int, n_col
```go\ntype Solution struct {\n\tnodes   [][2]int\n\thash    map[[2]int]bool\n\trow     int\n\tcol     int\n\tuseHash bool\n}\n\nfunc Constructor(n_rows int, n_cols int) Solution {\n\tuseHash := false\n\tnodes := make([][2]int, 0)\n\thash := map[[2]int]bool{}\n\tif n_rows*n_cols > 10000 {\n\t\tuseHash = true\n\t} else {\n\t\tfor r := 0; r < n_rows; r++ {\n\t\t\tfor c := 0; c < n_cols; c++ {\n\t\t\t\tnodes = append(nodes, [...]int{r, c})\n\t\t\t}\n\t\t}\n\t}\n\treturn Solution{\n\t\tnodes:   nodes,\n\t\thash:    hash,\n\t\trow:     n_rows,\n\t\tcol:     n_cols,\n\t\tuseHash: useHash,\n\t}\n}\n\nfunc (s *Solution) Flip() []int {\n\tvalue := make([]int, 2)\n\tif s.useHash {\n\t\tfor {\n\t\t\tr := rand.Intn(s.row)\n\t\t\tc := rand.Intn(s.col)\n\t\t\tif s.hash[[...]int{r, c}] == false {\n\t\t\t\ts.hash[[...]int{r, c}] = true\n\t\t\t\tvalue[0] = r\n\t\t\t\tvalue[1] = c\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\tindex := rand.Intn(len(s.nodes))\n\t\tvalue[0] = s.nodes[index][0]\n\t\tvalue[1] = s.nodes[index][1]\n\t\tcopy(s.nodes[index:], s.nodes[index+1:])\n\t\ts.nodes = s.nodes[:len(s.nodes)-1]\n\t}\n\treturn value\n}\n\nfunc (s *Solution) Reset() {\n\tif s.useHash {\n\t\ts.hash = map[[2]int]bool{}\n\t} else {\n\t\ts.nodes = make([][2]int, 0, s.row*s.col)\n\t\tfor r := 0; r < s.row; r++ {\n\t\t\tfor c := 0; c < s.col; c++ {\n\t\t\t\ts.nodes = append(s.nodes, [...]int{r, c})\n\t\t\t}\n\t\t}\n\t}\n}\n```
['Go']