Generate all subsequences of text1 and check which appear in text2.
A string of length has subsequences. Checking each in text2 takes time.
Total: . Way too slow.
The trap
Generate all subsequences of text1 and check which appear in text2.
A string of length has subsequences. Checking each in text2 takes time.
Total: . Way too slow.