Hard · Sliding window

Minimum Window Substring

You are given two strings, s and t. Return the shortest stretch of s that contains every letter of t, counting repeats. If there is none, return an empty string.

  • Upper and lower case are different letters.
  • The tests have only one shortest answer.
  • The letters of t can appear in any order inside the stretch.
s = "ADOBECODEBANC"
t = "ABC"

→ "BANC"
Record your take

No one has solved it yet.