In this problem, we will see how we can check whether a string is a subsequence of another string. Now we will consider an example to understand the given problem.
Let's say we have a string 'Welcome to OpenGenus' and a substring OGenus.
Now we need to find whether we have a substring or not.
mainString = S1 = "Welcome to OpenGenus";Subsequences (S2) are:OpenGenusOGenusWlcomepen [Notice we have deleted few characters in mainString]
Hence, S2 is a subsequence of S1 if we can convert S1 to ...
Published on June 01, 2021 14:02