Sponsored
Use these hints if you're stuck. Try solving on your own first.
The solution expects that we always use the original array to shuffle() else some of the test cases fail. (Credits; @snehasingh31)
Solve with full IDE support and test cases