Skip to content

Latest commit

 

History

History

consecutive-strings

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Consecutive strings

You are given an array strarr of strings and an integer k. Your task is to return the first longest string consisting of k consecutive strings taken in the array.

Example

longest_consec(["zone", "abigail", "theta", "form", "libe", "zas", "theta", "abigail"], 2) --> "abigailtheta"

n being the length of the string array, if n = 0 or k > n or k <= 0 return "".

Note

Consecutive strings : follow one after another without an interruption

Link

Codewars