/** Resets the array to its original configuration and return it. */ vector<int> reset(){ return nums; }
/** Returns a random shuffling of the array. */ vector<int> shuffle(){ auto res = nums; int n = res.size(); for (int i = n - 1; i > 0; --i) { swap(res[rand() % (i + 1)], res[i]); } return res; }
vector<int> nums; };
/** * Your Solution object will be instantiated and called as such: * Solution obj = new Solution(nums); * vector<int> param_1 = obj.reset(); * vector<int> param_2 = obj.shuffle(); */