Im struggling trying to remove some duplicates from an array. I have a spec which requires I do not not use inbuilt sorting & de-duplication methods...
so .uniq .sort etc. Are out of use...
Here is my array ...
array = [1, "fred", 6, 5, "fred", "john", 6, "peter", "fred"]
I need it to output...
sorted_array = [1, 6, 5, "fred", "john", "peter"]
So far I have tried to use a Set as well as array & array however that outputs in the wrong order. I need the integers to occur in the list before the strings...
I have also tried to iterate through, finding if an element occurs more than once and using .delete & .delete_at however I can't figure out how to delete the second/third/fourth occurring element...