Google OA 2024 - first subsequence question
Anonymous User
813

write a program to check whether string A contains string B as a subsequence or not. you can change at most 1 character in string B except the first character
return the starting index of subsequence if found
else return -1

Ex -

  1. A = abcbc
    B = cbe
    answer = 3 (1 based indexing)

  2. A = lhs
    B = rhs
    answer = -1 (you cannot change first character of B)

Comments (7)