PROBLEM LINK:Author: Ishpreet DIFFICULTY:EASY ADHOC PROBLEM:You are given two string S and T. Find the maximal length of some prefix of the string S which occurs in strings T as subsequence. EXPLANATION:In the problem, we are given two strings S and T. We need to find the largest prefix of S that is a subsequence of T. Clearly, In this problem, we just need to have one variable len having value of largest prefix and one variable pos for iterating string T, whenever we find the same alphabet as S in T, we increment our len variable. TESTER'S SOLUTION:
This question is marked "community wiki".
asked 03 Apr '16, 14:09
