Shortest Prefix That Can Form Each Target

Given a string s consisting only of digits '0' through '9', and an array of digit-only query strings targets, process every target independently.

For each target, find the minimum prefix le...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: