COVERING SUBSTRING
CodeChefOpen on judge ↗
Given a string S, and a string T, find the length of the smallest substring of S which contains all the characters of T - in any order. If no such substring exists, print -1. Input - The first line consists of the string S. - The next line consists of a single integer Q, the number of strings "T" that you would query for in S. - Then follow Q lines, each consisting of a single string T. Out
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start