[Community Puzzle] 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.


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


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.