solulubeta
Sign in
Story Problems / Strings
02.02 · Problem

Shortest Snippet Containing All Letters

Hard Sliding window with a 'missing' counter Pro

This problem is part of solulu Pro

A journalist has a long news text s and a list of required letters t (repeats matter: if t has two 'a's the snippet needs at least two 'a's). Find the shortest continuous snippet of s that contains every required letter.…

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 22 of 94 · updated 2026-10-12