Ad
  • Custom User Avatar

    You need to take a deeper look into your code. Right now it will always return true, because you're storing a character at some index, and then checking from beginning again so you reach the same index again, and obviously it will return true when you compare the 2.

    Make use of console.log to debug your code, avoid global variables, and take a closer look at the description. "aba" should return false.

  • Default User Avatar

    This comment has been deleted.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Your code always returns value after first iteration. You can easily see that if you add one print().

  • Default User Avatar

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

  • Custom User Avatar

    Your code is wrong. Not a kata issue.

    Ignore letter case.

  • Default User Avatar

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

  • Custom User Avatar

    Good bit of code golf. But definitely wouldn't want to come across this in a production codebase.

  • Custom User Avatar

    You need to import the libraries yourself.

  • Default User Avatar

    Why it doesnot has Arrays.stream()?

  • Default User Avatar

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

  • Custom User Avatar

    To OP: Please mark your post as having spoiler content next time.

  • Custom User Avatar

    That's because you have a subtle error in your logic: your code will return in the first iteration of the loop. Your code translates to something similar to: if this, return this, else return that (first iteration). By adjusting your overall structure (which in this case, is just modifying number of tabs/spaces for some line(s)), your code will pass.

  • Default User Avatar

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

  • Loading more items...