I have an input sequence like: "AABCCAADABDC" and valid sequences like - "AABA" and "BDC" The desired output is: Found the valid se