Required Length Codeforces Solution | Codeforces Problem Solution 2022
D. Required Length
time limit per test
2 secondsmemory limit per test
512 megabytesinput
standard inputoutput
standard outputYou are given two integer numbers, and . You may perform several operations with the integer .
Each operation you perform is the following one: choose any digit that occurs in the decimal representation of at least once, and replace by .
You want to make the length of decimal representation
Solution Click Below:- CLICK HERE
of (without leading zeroes) equal to . What is the minimum number of operations required to do that?
Input
The only line of the input contains two integers and (; ).
Output
Print one integer — the minimum number of operations required to make the length of decimal representation of (without leading zeroes) equal to , or if it is impossible.
No comments:
Post a Comment