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.
The initial solution setup uses a varargs parameter:
and these can be called either as
whoLikesIt("Alice", "Bob")
or aswhoLikesIt(new String[]{"Alice", "Bob"})
. So if you just keep the varargs everything works.For Java Users:
U need replace tests with this:
assertEquals("no one likes this", Solution.whoLikesIt(new String[] {}));
assertEquals("Peter likes this", Solution.whoLikesIt(new String[] {"Peter"}));
assertEquals("Jacob and Alex like this", Solution.whoLikesIt(new String[] {"Jacob", "Alex"}));
assertEquals("Max, John and Mark like this", Solution.whoLikesIt(new String[] {"Max", "John", "Mark"}));
assertEquals("Alex, Jacob and 2 others like this", Solution.whoLikesIt(new String[] {"Alex", "Jacob", "Mark", "Max"}));
Or use overload of method.
//Incorrectly specified input data for the task//
uhum... If variable name consist of one letter and using increment instead of operator += lead me to wrong results of tests 2 and 3? i look up the true answer and logic is the same as mine, but answer is wrong. i feel like i come back to jetbrains academy with them code checker.