Ad
  • Custom User Avatar

    if n = 0 or k > n or k <= 0 return ""

  • Custom User Avatar

    I struggled with the description as well you have to find the longest character string you can make with k words but the words have to be already next to each other. So for

    print(longest_consec(["zone", "abigail", "theta", "form", "libe", "zas", "theta", "abigail"], 2))

    abigailtheta is the longest character word made of two consecutive words in the list. thetaabigail is the same length but abigailtheta comes first so thats the correct answer

    Hope this helps :)

  • Custom User Avatar

    Never mind I had a print statement i used for debugging in my code which was printing out all the random test strings :)

  • Custom User Avatar

    My code works however i got a buffer error i assume because my code must be too ineffecient

  • Custom User Avatar

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