In these sorts of problems you can't take the simple approach, you've got to come up with a clever way to avoid actually simulating the eating of the candy bars.

Some hints (in rot13), for practice see how few hints you can use.

1. Gel cevagvat bhg juvpu onef ner rngra naq frr vs lbh pna frr n cnggrea.

2. Va lbhe fnzcyrf ybbx ng juvpu pnaql one vf gur svefg bar ercrngrq.

3. Lbh pna cebir guvf erfhyg ol pbafvqrevat jung unccraf nsgre lbh'ir fgnegrq ercrngvat pnaql onef, naq pbafvqrevat jurgure be abg bgure jnlf bs ernpuvat gur svany cbfvgvba ner cbffvoyr.

4. Pna lbh rkcerff gur ehyr sbe jura gur plpyr ercrngf zngurzngvpnyyl?

5. Qb lbh xabj gur zngurzngvpny anzr sbe gur svefg ahzore gung svgf gur ehyr?

6. Vgf YPZ.

This is one of the posted answers to this question: Improving the time complexity of my program

I can understand the reasoning behind not wanting to outline all of the points and straight give away the entire solution, as that would potentially rob the asker of the learning process. But is posting an answer like this really appropriate?

Would it be okay if the answer were in Spanish?

Would it be okay if the answer were encrypted using a less trivial encryption?

And finally, what's wrong with using the spoiler tags?

Hint 1:

This is a spoiler!

Hint 2:

This is another spoiler!

Hint 3:

I can now allow a user to limit himself to as many or few hints as they choose without this answer being a pain to decrypt for someone who wants to read the whole answer but doesn't have a decrypter/translater quickly accessible.

• Posting a question to meta immediately without seeing if perhaps I'd agree and change my original answers to spoilers is a little odd. The fact is, I simply didn't realize I could use spoilers. – Winston Ewert Sep 7 '14 at 16:51
• This is more for setting the policy rather than trying to make an example of anyone. If the community thinks this approach is fine, then fine. I just feel it's important that the policy is stated somewhere on the meta so that if someone less agreeable comes along, we can point to the meta and say "The community already had this discussion." – nhgrif Sep 7 '14 at 16:56
• I guess I don't see anything terribly wrong with it, but I'd definitely prefer to see spoiler markdown instead. – RubberDuck Sep 7 '14 at 18:07
• A cryptic answer to a poorly posed question. Garbage in, garbage out. – 200_success Sep 7 '14 at 18:12
• I don't think it's worth it to establish a policy for every possible odd situation. A mountain of policy just raises the barrier to entry, which is something you don't want for a large collaborative effort. – 200_success Sep 7 '14 at 18:14
• I disagree. Or rather, I disagree that a mountain of written policy raises the barrier to entry. If we're okay with this sort of answer, then the barrier to entry isn't raised. If we, however, are not okay with this sort of answer, the barrier to entry is raised regardless of whether or not there was a meta discussion about it. However, the barrier for entry is raised moreso if there's not a meta discussion about it, because despite it being policy, it's unwritten, so it's harder for newcomers to see or understand why the policy exists and they get little opportunity to speak their mind. – nhgrif Sep 8 '14 at 11:24

I wouldn't say that encrypted answers should be banned, and I also agree with 200_success' comment that

I don't think it's worth it to establish a policy for every possible odd situation.

However, spoiler tags are preferable instead of encrypted answers. In many cases, I guess it's just the case of the poster not knowing about the other options available. As was the case here:

The fact is, I simply didn't realize I could use spoilers. – Winston Ewert 6 hours ago

I don't see an issue with the encrypted answer, but I would definitely prefer to see the spoiler markdown instead. It keeps everything nicely packaged right here on Code Review without needing any external resources /or links.

For those who may not know how to use it, this

Hint 1:
>! This is a spoiler!

Hint 2:
>! This is another spoiler!

Hint 3:
>! I can now allow a user to limit himself to as many or few hints as they choose without this answer being a pain to decrypt for someone who wants to read the whole answer but doesn't have a decrypter/translater quickly accessible.


Will produce this rendered output.

Hint 1:

This is a spoiler!

Hint 2:

This is another spoiler!

Hint 3:

I can now allow a user to limit himself to as many or few hints as they choose without this answer being a pain to decrypt for someone who wants to read the whole answer but doesn't have a decrypter/translater quickly accessible.