Remove Duplicate Array Values

Ruby

Using monkey patching, create a method called remove_duplicates in the array class that will remove duplicate entries in a given array.

describe 'Duplicate removal' do
  it 'Removed duplicates from an array' do
    arr = [1, 3, 4, 1, 4]
    expect(arr.remove_duplicates).to eq([1, 3, 4])
  end
end
class Array def remove_duplicates end end
< >