[Community Puzzle] Closest Number


#1

https://www.codingame.com/training/hard/closest-number

Send your feedback or ask for help here!

Created by @Nagrarok,validated by @Stilgart,@jitsch and @Fireball0923.
If you have any issues, feel free to ping them.


#2

any hint to work with big numbers?
I am using the ruby permutation method but it times out on the big numbers


#4

This puzzle is indeed about string manipulation. But there is no need for permutations.

Look closely at the solutions for the given tests and you might see a property that decreases a lot the number of cases to consider.