I wrote this puzzle 1 year ago. It was a proposition for clashes. The rules of the puzzle are really bad written. Moderators should have modified it before validating.
I know but i can’t find a way to write it better than it for now. I know the text is bad written, but well, i can’t really do better I never said i was good at making puzzles !
I don’t quite understand this puzzle. Leading zeroes are not permitted, but for the 4th test case it expects “-0…[something]”. The input is -400598.2 , so should the output not be -2.4589? And while it says not to end a number with a decimal, it says nothing of how far to the right a decimal can be. Although from the first test case -2.45889 is correct, it would make more sense for the answer to be -.245889.
I have code that works for half of the test cases, so I really want to finish this problem, but I’m frustrated that I can’t understand how the samples should output. Can someone explain to me more precisely what the rules are to this problem?
The syntax ‘.xxxx’ is incorrect for a number, even though we understand it, behind this way of writing the real number is ‘0.xxxx’ and so this is how you are supposed to output the answer. You should understand that unnecessary leading zeros are not permitted.
There is a test “Gérer le zéro une 2ème fois” which is in my opinion wrong. It claims that the greatest number from characters “0 0 0 1 0 0 0 .” is “100000”. The issue is that this solution misses the decimal point. I think the correct result should be “0.000001”.
eulersheZahl is right. The real response is 100000.0, but as the rules says, at the output, trailing zero must be removed. So you have to output 100000.
The trick is not to use all the zeros. Write the number as a decimal with one zero after the decimal point, but then delete the trailing zero because it adds nothing to the answer, and then delete the decimal point because you don’t need it. So the answer for this case is 100000, not 100000.0