Ad
  • Custom User Avatar

    I completely agree. The way it is worded is ambiguous, because technically speaking, the following statement, "[i]f a chunk represents an integer such as the sum of the cubes of its digits is divisible by 2, reverse that chunk; otherwise rotate it to the left by one position", has a nearly vacuous antecedent. Namely, assuming that the input is always of integer type and assuming that every chunk is of appropriate length (which themselves are light weight assumptions), then it will always be true, said condition. In other words, it will always be true that the chunk is an integer. Why is this? It is because when you say "such as" it has the equivalent idiomatic meaning of "perhaps", which means it may or may not be true (or, in this case, it may or may not be required to be true). Thus, the real condition of importance is then "[i]f a chunk represents an integer".

    I believe the author meant to say "[i]f a chunk represents an integer [wherein] the sum of the cubes of its digits is divisible by 2 [...]". By making this small adjustment in language, the problem specification is now completely clear and unambiguous. I suggest this change (or similar, if deemed appropriate) be made.

    Otherwise, this is a great little kata!