We should begin by reasoning out what we need to do in plain English before diving into the logic.
Let's take a simple example:
If we wanted to know if car
was in carnival
, that's easy. The first few letters are the same.
SNIPPET
1c a r
2c a r n i v a l
3^ ^ ^