Write a function
that finds the largest number that can be written with at most
digits taken from
,
and written in the same order as they appear in
.
Both
and
are nonnegative integers.
Observation
The digits of all numbers are assumed to be as written in base
10.
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.