It will be slow because it will contain lots (tons) of loops and I2S and S2I function, isn't it ?
I will tell of what I thought:
I could save an array data like this "[1,3,5,2]=1001005/" and then do a string search for the value between the character "=" and "/"