In ruby, how do I test that one array not only has the elements of another array, but contain them in that particular order?
correct_combination = [1, 2, 3, 4, 5
I would suggestion a for loop that compares each one
@out_of_order_elements = [] for i in 0.. @array_size do unless submission_array[i] == @correct_combination[i] @out_of_order_ids.push(@submission_array[i]) end end