Back to General discussions forum
I'm just leaving this here for whoever is trying to attemp this task in Python... Please remember that round has this logic implemented: https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex x rounded to n digits, rounding half to even. If n is omitted, it defaults to 0.
In my particular case, I was getting these values and round "rounded" them but they were different from the expected output: 46.153846153846146 46 62.5 62
Please keep this in mind when implementing the solution in Python
That's curious you haven't encountered this earlier in other tasks using rounding :)
With Python one should first set proper rounding mode, before using it - or round "manually" with int(x+0.5)
...