Explore the dynamic landscape of technology with TechTrajectory. This blog offers a unique perspective on the ever-evolving tech world, shedding light on the intricacies of system design and the latest innovations.
392.IsSubsequence class Solution: def isSubsequence(self, s: str, t: str) -> bool: for c in s: i = t.find(c) if i == -1: return False else: t = t[i + 1:] return True if __name__ == '__main__': sol = Solution() assert sol.isSubsequence("abc", "ahbgdc") assert not sol.isSubsequence("axc", "ahbgdc")