Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @DeyvidNeshev,validated by @celeria,@ethan-alexander and @Delicious31415.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @DeyvidNeshev,validated by @celeria,@ethan-alexander and @Delicious31415.
If you have any issues, feel free to ping them.
A bit of a nit, but test case 3 is invalid if the instructions are read carefully:
If 28 is a solution, it must be missing from the numbers written on the board, yet it is explicitly defined as the largest number written on the board. So there is no valid solution for this test case.
Thank you for reporting. I’ve just added before the disappearance to the description.
In my opinion that makes the problem
The teacher originally wrote 1 to N on the board, and Gauss could easily have seen that before lunch (the statement is silent on that point). Nothing especially unrealistic is introduced by specifying the original upper bound.
While it is certainly possible to solve the problem in a single line of code (excluding input reading), only one published Python solution currently does so. Conceptually, the solution still involves several distinct steps, so there remains genuine problem-solving involved, even if the task itself is elementary. After all, the puzzle is classified as Easy.
Whether a puzzle is “more interesting” is ultimately a matter of taste. You may well be right that the alternative interpretation could lead to a richer reconstruction-style problem. However, I do not want to revise the published statement in a way that effectively turns it into a different puzzle from the one originally intended by the author and approved during review, especially given that 99 people have solved it at the moment. The current version is meant to be a direct algebra exercise, rather than a reconstruction puzzle involving incomplete knowledge of the range.