Ad
  • Custom User Avatar

    Could you explain what does strarr[index:index +k] do

  • Custom User Avatar

    I found something Helpful suggestion from early comments and just want to repost what he commented
    It is pretty helpful to understand that's why..
    Crd --- Tigerdevon
    Example:

    longest_consec(["it","wkppv","ixoyx", "3452", "zzz4zzzz9zzz"], 3)
    The three options:

    1) [0]"it"    [1]"wkppv" [2]"ixoyx"        ; "itwkppvixoyx"
    2) [1]"wkppv" [2]"ixoyx" [3]"3452"         ; "wkppvixoyx3452"
    3) [2]"ixoyx" [3]"3452"  [4]"zzz4zzzz9zzz" ; "ixoyx3452zzz4zzzz9zzz" 
    

    k(int) is the reason why there are 3 strings per answer

    The answer is:

    3) "ixoyx3452zzz4zzzz9zzz"

  • Custom User Avatar

    No, because that's not what you have to do.

    Your task is to return the first longest string consisting of k consecutive strings taken in the array.

    You have to return the first one if there are more than one with the same length.

  • Default User Avatar

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