Tap here to switch tabs
Problem
Submissions

Problem: Count Substrings That Differ by One Character

med
30 min
Try to solve the Count Substrings That Differ by One Character problem.

Statement

Given two strings s and t, return the number of pairs of substrings that differ by exactly 11 character.

A pair of substrings (ssub,tsub)(s_{sub}, t_{sub}) is valid if ssubs_{sub} is a substring of s, tsubt_{sub} is a substring of t, they have the same length, and they differ at exactly 11 position.

Note: A substring is a contiguous sequence of characters within a string.

Constraints:

  • 1≤1 \leq s.length, t.length ≤100\leq 100

  • s and t consist of lowercase English letters only.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Substrings That Differ by One Character

med
30 min
Try to solve the Count Substrings That Differ by One Character problem.

Statement

Given two strings s and t, return the number of pairs of substrings that differ by exactly 11 character.

A pair of substrings (ssub,tsub)(s_{sub}, t_{sub}) is valid if ssubs_{sub} is a substring of s, tsubt_{sub} is a substring of t, they have the same length, and they differ at exactly 11 position.

Note: A substring is a contiguous sequence of characters within a string.

Constraints:

  • 1≤1 \leq s.length, t.length ≤100\leq 100

  • s and t consist of lowercase English letters only.