Let’s say I have a list a which is [1,2,9,5,4,3,6] and another list b which is [5,4]. I want to find the first (or last, doesn’t matter) instance of list b in list a here it would be 4 because the elements 4 and 5 of list a are the same as elements 1 and 2 of list b.

I tried making this MONSTER of a function and I think it would work but desmos doesn’t support lists inside of other lists.

here is the “code” for it: f_{inditeminlist}\left(i_{temtofind},l_{isttosearchin}\right)=-\operatorname{sort}\left(-\left[\left{\left[l_{isttosearchin}\left[i+k\right]\operatorname{for}k=\left[0…i_{temtofind}.\operatorname{length}-1\right]\right]=i_{temtofind}:i,0\right}\right]\right)\left[1\right]

For anyone wondering what I’m using this for, I am making a programming language in desmos, and I need that to find the position of the definition of a custom function.

If you can help, please do!