Ad
  • Custom User Avatar

    Just to say, I think this is a very efficient approach (if I say so myself), it seems to run faster then a lot of other solutions which have less code.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Was just thinking it could return true or false even in a null case. Null ending parameter is (gracefully) handled so why not the str parameter too?

  • Custom User Avatar

    Null 'str' parameter is unhandled though :'(

  • Custom User Avatar

    Ah ok cheers, I get it now, appreciate your time all.

  • Custom User Avatar

    I think this description is very badly worded, perhaps its missing details or the tests are invalid, I'm doing it in Java 8 and find some of the test cases appear to contradict each other.

    My question is what is missing from the description?
    I need enough information to make it obvious why the below tests are correct, currently they appear invalid.

    1. "zone", "abigail", "theta", "form", "libe", "zas", "theta", "abigail" with 2, expects: abigailtheta
    2. "itvayloxrp","wkppqsztdkmvcuwvereiupccauycnjutlv","vweqilsfytihvrzlaodfixoyxvyuyvgpck" with 2, expects: wkppqsztdkmvcuwvereiupccauycnjutlvvweqilsfytihvrzlaodfixoyxvyuyvgpck
    3. "wlwsasphmxx","owiaxujylentrklctozmymu","wpgozvxxiu" with 2, expects: wlwsasphmxxowiaxujylentrklctozmymu
    4. "it","wkppv","ixoyx", "3452", "zzzzzzzzzzzz" with 3, expects: ixoyx3452zzzzzzzzzzzz

    1- appears to say: find the first largest string, and then take that and one more string from the array (equaling two), and that matches the description
    2- appears to match test 1
    3- this appears to say take the second largest string 'wlwsasphmxx' first and then the largest 'owiaxujylentrklctozmymu'
    4- even weirder, this appears to say take the third largest string and get the three consecutive strings from the array.. but no logic that would facilitate that is mentioned in the description.