Skip to content

Instantly share code, notes, and snippets.

const S = "SMS messages are really short";
const K = 12;
function solution(S, K) {
const arr = S.split(" ").map(word => word.length);
let messagesCount = 1;
let message = arr[0];
for (let i = 1; i < arr.length; i += 1) {