Is Subsequence

Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string formed from the original by deleting some characters without disturbing the relative positions of the remaining characters.

Constraints

  • 0 <= s.length <= 100
  • 0 <= t.length <= 10^4
  • s and t consist only of lowercase English letters.
Saving… · 2 lines
class Solution:
def isSubsequence(self, s: str, t: str) -> bool:
Console

Click Run to execute sample tests.