julia> a=[(1,1),(1,2),(1,3),(1,4),(2,1),(2,2)]
6-element Vector{Tuple{Int64, Int64}}:
(1, 1)
(1, 2)
(1, 3)
(1, 4)
(2, 1)
(2, 2)
There is a vector called a.If i input 1,I want to return [1,2,3.4].Also if I input 2,I want to return [1,2].Thanks for helping me.
And I also want to know the index of (1,4) in a.I wrote findfirst((x,y)->x==1&y==4,a),but it didn’t work.
Would you please to help me.Thanks.