less than 1 minute read

Given two strings s0 and s1, return whether you can obtain s1 by removing 1 letter from s0.

Constraints

  • 0 ≤ n ≤ 200,000 where n is the length of s0
  • 0 ≤ m ≤ 200,000 where m is the length of `s1

https://binarysearch.com/problems/Remove-One-Letter

Examples

Example 1

Input

  • s0 = hello
  • s1 = hello

Output

  • answer = False

Example 2

Input

  • s0 = hello
  • s1 = helo

Output

  • answer = True

Solution

Leave a comment