Tap here to switch tabs
Problem
Submissions

Problem: Longest Common Prefix After at Most One Removal

Longest Common Prefix After at Most One Removal compares two strings and asks for the greatest shared prefix length after deleting zero or one character from the first string.

Statement

You are given two strings, s and t.

Return the maximum length of the longest common prefix shared by s and t after deleting at most 11 character from s.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • 1≤1 \leq t.length ≤105\leq 10^5

  • s and t consist only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Common Prefix After at Most One Removal

Longest Common Prefix After at Most One Removal compares two strings and asks for the greatest shared prefix length after deleting zero or one character from the first string.

Statement

You are given two strings, s and t.

Return the maximum length of the longest common prefix shared by s and t after deleting at most 11 character from s.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • 1≤1 \leq t.length ≤105\leq 10^5

  • s and t consist only of lowercase English letters.