Ad
  • Custom User Avatar

    OP solved it closing

  • Default User Avatar

    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

  • Default User Avatar

    Thanks for the reply. Yep bad formatting, thanks for the link.
    In terms of checking adjacent characters that is based on sorting the characters initially with the Arrays.sort(arr) line.
    Maybe I need to just start over.

  • Default User Avatar

    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.

    matchArray[i] = (arr[i])

    That line just fills the array with holes when if condition isn't met, and the if 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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution