String subsequences

Question

Given two strings, String A and String B, write a function to return whether or not String A is a subsequence of String B. For String A to be a subsequence of String B it must be able to be derived from it by deleting some number of elements (without changing the order of the elements).

For example:

# Inputs:
String A = 'race'
String B = 'razcecar'

#Output: True
-------------
#Inputs:
String A = 'xyz'
String B = 'wyzx'

#Output: False

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now