Awesome but too short. I'd prefer it more explict.
pretty smart actually.
This comment is hidden because it contains spoiler information about the solution
I am a beginner and I am wondering if it is worth it to add a whole library to the project only to use the simple accumulate function which can be done with one line of ranged for loop.
Really nice answer, i tried using a ternery but couldnt quite do it successfully.
I do know regex :) What I didn't know was how to manage gsub with it and it is actually more difficult to read what is considered the top answer.
Experience not cheating.
My code can work for all collections, yours only for std::vector.
cheating...
I had this issue when I ended up not returning anything from a function that had a return value (non void function skipped its return statement).
Same answer here.... we really need to learn some Regex...
Your current solution prints the number to the screen and returns void. Instead, your function should return the rounded number.
Loading collection data...
Awesome but too short. I'd prefer it more explict.
pretty smart actually.
This comment is hidden because it contains spoiler information about the solution
I am a beginner and I am wondering if it is worth it to add a whole library to the project only to use the simple accumulate function which can be done with one line of ranged for loop.
Really nice answer, i tried using a ternery but couldnt quite do it successfully.
I do know regex :) What I didn't know was how to manage gsub with it and it is actually more difficult to read what is considered the top answer.
Experience not cheating.
My code can work for all collections, yours only for std::vector.
cheating...
I had this issue when I ended up not returning anything from a function that had a return value (non void function skipped its return statement).
Same answer here.... we really need to learn some Regex...
This comment is hidden because it contains spoiler information about the solution
Your current solution prints the number to the screen and returns void.
Instead, your function should return the rounded number.