If I have 2 arrays, for example a = [1, 2, 3, 4, 5] and b = [4, 7, 9, 1]
and I want to use a method to change elements of the first one. For example
a.map {|x| x.to_s}
but I don't want to change elements that are the same as in the array b. In this case my desire result would be
a = [1, "2", "3", 4, "5"]
1 and 4 are still integers, because the array b has this elements.
So how can I implement this task?
arrays and methods are used just for example to explain what I mean.