 All Problems
Is Subsequence
easy
strings
two pointers
dynamic programming
google
amazon
microsoft
facebook

Given two strings s and t, return true if s is a subsequence of t.

A subsequence is formed by deleting some characters without changing relative order.

Example 1:

Input: abc
       ahbgdc
Output: true

Example 2:

Input: axc
       ahbgdc
Output: false

Input format: Line 1 = s, line 2 = t.

Run to check your code against the sample cases, or submit to run every case