An integer array “original” is transformed into a doubled array “changed” by appending twice the value of every element in “original”, and then randomly shuffling the resulting array.Given an array “changed”, return “original” if “changed” is a doubled array. If “changed” is not a doubled array, return an empty array. The elements in “original” may…