Click the green flag to run the first example. See inside for comments on how to run different inputs.
Cassido interview question of the week for 11/14/2022 Given a list of strings arr, and a max size n, return a new list where the strings (from left to right) are joined together with a space, so that each new string is less than or equal to the max size. > combineStrings(["a", "b", "c", "d", "e", "f", "g"], 5) > ["a b c", "d e f", "g"] > combineStrings(["a", "b", "c", "d", "e", "f", "g"], 12) > ["a b c d e f", "g"] > combineStrings(["alpha", "beta", "gamma", "delta", "epsilon"], 20) > ["alpha beta gamma", "delta epsilon"]