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.
it's just a way to check the common elements between two sets: old groups the player plaied in and the new group. The only common element must be the player itself
This comment is hidden because it contains spoiler information about the solution
can any one explain this..
can you please tell me how it will take only bcacb.as according to my code it will take character from end so "abcacba" it will take "a" from end and index wil be start from 0 and it is found at ""0"" index because index is search from 0th index. therefore substring will become "abcacba"....
You might want to add
Test.assertEquals(longestPalindrome("abcacba"), 7)
as a test case. I've seen a solution which effectively iterates the array, for each character looks up the next index of of that character and decides if it's a palindrome -- this case will fail that method because it will only considerbcacb
as a palindrome, since a -> a would only get the first half of the palindrome in the string.This comment is hidden because it contains spoiler information about the solution