I have three arrays: g, a and b. g has two groups of one or more consecutive nil values. The first (second) group contains a.size (b.size) nils. I wish to replace each nil in the first (second) group with the corresponding element of a (b). For example, if:
g = [1, 2, nil, nil, nil, 3, nil, nil, nil, nil]
a = [55, 45, 56]
b = [100, 200, 300, 400]
I wish g to become:
[1, 2, 55, 45, 56, 3, 100, 200, 300, 400]
How can I do that?
gout "correctly" the first time? What are you trying to accomplish here?