Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
OP solved it closing
Ah, that makes some sense, but I think how you're checking it is not gonna work. I'd suggest starting over and looking at other ways to solve the problem, maybe there's some data structures that could help you o_O
I'm really struggling to figure out what is it that you're trying to do.
Your code seems to be checking only adjacent characters, but they could repeat anywhere in the string.
That line just fills the array with holes when
if
condition isn't met, and theif
before doesn't make much sense.The first
if
makes no sense to me whatsoever, I don't know when it would ever be true.Fundamentally, the way you're checking for repeating characters seems to be way off =/
Also, when posting code, please use Markdown Formatting which makes code easier to read.