Jan Rad wrote:I am supposed to write a program which returns the maximum possible value obtained by inserting one '5' digit inside decimal representation of integer N
Example:Given N=268, the function should return 5268
Given N=670, the function should return 6750
I wrote:When something seems difficult to do, I find it's often because too much is being done in one place and the intent is getting obscured by implementation details.
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton