Consider a toy list
l = {x[2],x[32],x[43],x[56],x[72]};
I would like to find the position of the first element within this list, for which x[y]
is such that y>N
where N
is a positive integer that I will specify. In case if N
is bigger than any label of any x[y]
, then the result should be zero. So for example:
getPos[l,35]
3
getPos[l,60]
5
getPos[l,80]
0
How can I do that in an efficient manner?
FirstPosition
? $\endgroup$x[n_] := 3; l = {x[2],x[32],x[43],x[56],x[72]};
$\endgroup$