[Community Puzzle] Gauss and the Stolen Numbers - Puzzle discussion

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:

  • Instructions say N is the largest natural number written on the board.
  • In test case 3, N is given as 28
  • In test case 3, the accepted solutions are 27 and 28

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.

1 Like

Thank you for reporting. I’ve just added before the disappearance to the description.

In my opinion that makes the problem

  • somewhat less realistic (we magically know `n` although it might be one of the erased numbers!?)
  • slightly less interesting to code (with n being the biggest number before the disappearance, solving this problem can be done in just one line: just write the arithmetic expression for the missing two numbers and assume it will work. if n was the biggest number remaining after the disappearance, then solving this problem requires error-checking and handling three possible cases)

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.

  1. 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.

  2. 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.

I find the statement to be inconsistent and illogical. The problem is initially stated as 2 numbers having disappeared, but if that were the case then we would only need to find the two numbers that are not written, and the sums would be redundant. “All that remains” technically means that every number was removed.

I think that the statement should be changed to:
…
When the class went out for lunch, the numbers were replaced with the sum and the sum of squares of all but {{two}} of the original numbers.

Find the {{two}} original numbers that were not used to calculate the sums.

1 Like

Absolutely spot-on! I agree that the original statement is a bit inconsistent.

One thing worth considering, though, is trying to preserve as much of the original wording as possible. For example, the phrase “mysteriously disappeared” adds a bit of context and character to the problem, which is lost in the suggested rewording.

It would be equally important to consider how any changes to the statement might affect the consistency with the Input and Output sections, so those would need to be reviewed and adjusted accordingly if necessary.

I noticed that you’ll soon reach Level 29 and gain the right to edit puzzles. If you’re willing, would you consider taking on this rewording task once you unlock that right? You could then leave a comment in the contribution area explaining the changes you’ve made and the reasoning behind them.

Thanks for the thoughtful feedback!

1 Like