原创 Getting the indexes of duplicate elements in arrays (Ruby)

I have an array in Ruby that has some duplicate elements. E.g.: fruits = ["apples", "bananas", "apples", "grapes", "ap