Fog Creek Software
Discussion Board

Sum it up is poorly defined

Given the wording of the "sum it up" problem, the numbers could be given in an array -- or by any other means.  Given the memory constraint aspect of the problem, I believe this problem would be more valuable to the reader if it was clarified that the numbers are presented in some way where they do not occupy a useful region of memory, such as in successive arguments to a function or some such.

Michael Anthony
Tuesday, December 31, 2002

And of course the title supplies the answer to the problem, which is not ideal for the reader wishing to solve it on his or her own.

Michael Anthony
Tuesday, December 31, 2002

More to the point, the problem definition states that the numbers will be given in order, which certainly makes for a trivial solution.

Note that the example maintains confirms that the trivial approach should work.

David Stewart Zink
Thursday, January 9, 2003

*  Recent Topics

*  Fog Creek Home