move used elements to the end of a vector
rust []\nuse rand::Rng;\nuse std::mem;\n\nstruct Solution {\n    m: i32,\n    n: i32,\n    sz: usize,\n    ix: Vec<i32>\n}\n\nimpl Solution {\n\n    fn new(m: i
```rust []\nuse rand::Rng;\nuse std::mem;\n\nstruct Solution {\n    m: i32,\n    n: i32,\n    sz: usize,\n    ix: Vec<i32>\n}\n\nimpl Solution {\n\n    fn new(m: i32, n: i32) -> Self {\n        Self {m, n, ix: (0..(m*n)).collect::<Vec<_>>(), sz: (m*n) as usize}\n    }\n    \n    fn flip(&mut self) -> Vec<i32> {\n        let mn = (self.m*self.n) as usize;\n        let k = rand::thread_rng().gen_range(0..self.sz); \n        let ij = self.ix[k];\n        self.ix.swap(self.sz-1, k);\n        self.sz -= 1;\n        vec![ij % self.m, ij / self.m ]\n    }\n    \n    fn reset(&mut self) {\n        self.sz = self.ix.len();\n    }\n}\n\n```
['Rust']