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.
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.This comment has been deleted.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Your code always returns value after first iteration. You can easily see that if you add one print().
This comment is hidden because it contains spoiler information about the solution
Your code is wrong. Not a kata issue.
This comment is hidden because it contains spoiler information about the solution
Good bit of code golf. But definitely wouldn't want to come across this in a production codebase.
You need to import the libraries yourself.
Why it doesnot has Arrays.stream()?
This comment is hidden because it contains spoiler information about the solution
To OP: Please mark your post as having spoiler content next time.
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.
This comment is hidden because it contains spoiler information about the solution
Loading more items...