For example, ["Hey", "Buy", "These", "Shoes", "Today"] with k = 2
What 2 consecutive concatenated elements from the array form the longest string? So the possible combinations of 2 consecutive concatenated elements would be "HeyBuy", "BuyThese", "TheseShoes" & "ShoesToday". You should return "TheseShoes". If there are multiple combinations with equal length, return the first that was found. Which is why "ShoesToday" was ignored.
"Given 2 arguments, an array and an integer (represented by k), your task is to return a string that represents the very first longest block of consecutive elements in the array. The amount of elements permitted in the block is represented by k.
if n being the length of the array; if n = 0 or k > n or k <= 0 return ""."
What's your Python visualizer of choice?
This comment is hidden because it contains spoiler information about the solution
The values
0
,[]
,""
,False
andNone
are falsy in a boolean expression, in this caseif new_plan
meanslen(new_plan) != 0
.Find the area of the shape, seems simple enough.
OMG the desciription to this is worse than some trello tickets I see.
For example, ["Hey", "Buy", "These", "Shoes", "Today"] with k = 2
What 2 consecutive concatenated elements from the array form the longest string? So the possible combinations of 2 consecutive concatenated elements would be "HeyBuy", "BuyThese", "TheseShoes" & "ShoesToday". You should return "TheseShoes". If there are multiple combinations with equal length, return the first that was found. Which is why "ShoesToday" was ignored.
check rantenor's comment...
"Given 2 arguments, an array and an integer (represented by k), your task is to return a string that represents the very first longest block of consecutive elements in the array. The amount of elements permitted in the block is represented by k.
if n being the length of the array; if n = 0 or k > n or k <= 0 return ""."