leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0384.cpp (309B)


      1 class Solution {
      2     const vector<int> og;
      3     vector<int> shuffing;
      4 
      5   public:
      6     Solution(const vector<int> &nums) : og(nums), shuffing(nums) {}
      7 
      8     vector<int> reset() { return og; }
      9 
     10     vector<int> shuffle() {
     11         random_shuffle(shuffing.begin(), shuffing.end());
     12         return shuffing;
     13     }
     14 };