Skip to content

#392 - Is Subsequence

EasyTwo Pointers
Open on LeetCode

Given two strings s and t, return true if s is a subsequence of t, i.e. s can be obtained by deleting some (or no) characters from t without changing the order of the remaining characters.

InputOutput
s = "abc", t = "ahbgdc"true
s = "axc", t = "ahbgdc"false
s = "", t = "ahbgdc"true

Released under the MIT License.