Smallest Window Contains Pattern

Programming Interview Hard 4 views
Back to Questions

Problem Description

You get {x}. Compute the length of smallest substring of s that contains all characters of p with at least same counts. If not possible output 0.

Input Format

Two lines: s then p.

Output Format

One integer minLen or 0.

Sample Test Case

Input:
ADOBECODEBANC ABC
Output:
4

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next