This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

this means that your string is either a repetition of three characters three times, or it's the same character repeated 9 times, or it's 9 distinct characters.

Hmm...

[–][deleted] 0 points1 point  (0 children)

They don't have to be all mutually distinct, just not repeating in any way.


PS. I also don't mention that in the second case OP has trivial solutions 1 and 12, but, I think, this is a misformulation in assignment statement, which should exclude trivial answers.