Say I have an array of arrays that looks like this:
[[1830, 1], [1859, 1]]
What I want to do is quickly scan the internal arrays to see if any of them contain the number 1830. If it does, I want it to return the entire array that includes the number 1830, aka [1830, 1] from the above example.
I know for a normal array of values, I would just do array.include? 1830, but that doesn't work here, as can be seen here:
@add_lines_num_start
#=> [[1830, 1], [1859, 1]]
@add_lines_num_start.include? 1830
#=> false
@add_lines_num_start.first.include? 1830
#=> true
How do I do that?
[[1830,1], [2, 1830], [3, 1492]]and the number of interest was1830. Is[[1830,1], [2, 1830]]to be returned?