I have an array:
arr2 = [6, '(7,0)', '(15,0)', '(5,0)', 3, '(15,2)', 17]
I want to parse each element of the array and get the value as follows:
arr2 = [6, 0, 0, 0, 3, 2, 17]
means if the array element is like (15,2) then only the second element i.e 2 should get printed in the response, and if the array element is not in the format like (7,0) then it should be printed as it is.
arr2is an invalid structure in Ruby.[6, (7,0), (15,0), (5,0), 3, (15,2), 17]is not a valid ruby object and you again come with it. Downvoted and voted to close.