Hello there. I deleted last comments cause i found misleading advises from my side xD. I think the simplest(probably not the best) way will be First dynamically get input array size. When it’s for example 3 check all of your 3length sequences. If right sequence isnt found continue adding next input to the array. Check for 4 length sequence. If its wrong check again 3length input but for the last three inputs ignoring first input and so on each time you add new input to the array check all of the smaller sequences from the back of array. I advise you to look in the internet for more information about buffer system in SF like games. One more thing try to do it on the paper first and then try algorithm in UE. Also answering for your question about branching you should do it after adding new input to the array.