Dashboard
LC #392

Is Subsequence

Pattern · ?

Problem

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

Constraints

  • 0 ≤ s.length ≤ 100
  • 0 ≤ t.length ≤ 10⁴
  • Both consist of lowercase English letters.

Example

Input
s = "abc", t = "ahbgdc"
Output
true
Why
We can find "a", "b", "c" in order within "ahbgdc".

Spot the pattern

Which pattern cracks it?

Hints

One at a time
Solve on LeetCode ↗