Easy · Two pointers

Is Subsequence

You are given two strings, s and t. Return whether s is a subsequence of t: whether its letters all appear in t, in the same order, though not necessarily side by side.

  • An empty s is a subsequence of anything.
  • Everything is lowercase letters.
  • Letters of t can be skipped but not reordered.
s = "abc"
t = "ahbgdc"

→ true
Record your take

No one has solved it yet.