give integer array num design algorithm randomly shuffle array all permutation array equally likely result shufflingimplement solution classsolutionint num Initializes object integer array numsint reset Resets array original configuration return itint shuffle return random shuffle array Example 1inputsolution shuffle reset shuffle1 2 3 outputnull 3 1 2 1 2 3 1 3 2explanationsolution solution new Solution1 2 3solutionshuffle Shuffle array 123 return result any permutation 123 equally likely return Example return 3 1 2solutionreset Resets array original configuration 123 return 1 2 3solutionshuffle return random shuffle array 123 Example return 1 3 2 constraints1 numslength 50106 numsi 106all element num uniqueAt 104 call total reset shuffle