# Shuffle an Array

Problem Link: <https://leetcode.com/problems/shuffle-an-array/>

```python
class Solution:

    def __init__(self, nums: List[int]):
        self.original=nums[:]
        self.duplicate=nums[:]
        

    def reset(self) -> List[int]:
        self.duplicate=self.original[:]
        return self.original
        

    def shuffle(self) -> List[int]:
        n=len(self.original)
        for i in range(n):
            # Generate random integer b/w i and n.
            # Than, swap arr[i],arr[randint]
            random_int=randint(i,n-1)
            self.duplicate[i],self.duplicate[random_int]=self.duplicate[random_int],self.duplicate[i]
        
        return self.duplicate
```
