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.
Example:
['BBB', 'AAAA', 'C'], 2
Two possible strings are
'BBBAAAA'
and'AAAAC'
.The first one is longer, so
'BBBAAAA'
is the answer.In description : return the first longest string consisting ......
It need to begin at the first longest string.
I tried to print the random test's arguments.
They are below:
array(3) {
[0]=>
string(11) "wlwsasphmxx"
[1]=>
string(23) "owiaxujylentrklctozmymu"
[2]=>
string(10) "wpgozvxxiu"
}
k is 2
Then it tell me :
Failed asserting that two strings are equal.
Expected: 'wlwsasphmxxowiaxujylentrklctozmymu'
Actual : 'owiaxujylentrklctozmymuwpgozvxxiu'
I don't know why it begin from "wlwsasphmxx"? "wlwsasphmxx" is not longest, right?
They have to be consecutive. I think you should read the description and examples again. Good luck.
If there are many the same length strings in it.
['AAA','BB', 'C', 'DDD', 'EEE', 'FFFFFF']
K = 2
which one is it should return FFFFFFAAA or FFFFFFAAADDDEEE?