9th question of august long challenge(chef and digits of large)

[Solution: 49840440 | CodeChef] this is my solution but as it is bruteforce,it shows TLE.J.ust wanted to understand the correct approach.
by the way ,here is the link of the question[Contest Page | CodeChef]

Have you read the Editorial?

1 Like