So was testing my self and got stuck on a hard problem. So I have this code, which randomizes the given sequence.