less than 1 minute read

Given two lowercase alphabet strings s and t, return the minimum amount of operations on s required to make t a substring of s. In each operation, you can choose any position in s and change the character at that position to any other character.

Constraints

  • 0 ≤ m ≤ n ≤ 100 where n is the length of s and m is the length of t

https://binarysearch.com/problems/Substringify

Examples

Example 1

Input

  • s = foobar
  • t = oops

Output

  • answer = 2

Explanation

We can take the substring "ooba" and change 'b' to 'p' and 'a' to 's'.

Solution

Categories:

Updated:

Leave a comment