Skip to content

Instantly share code, notes, and snippets.

View quickEscape's full-sized avatar
🦄

Yevhenii Kononko quickEscape

🦄
  • Playtika
  • Ukraine, Kyiv
View GitHub Profile
@quickEscape
quickEscape / taskt-example.md
Last active November 27, 2019 08:46 — forked from romabelka/taskt-example.md
Kickstart testing example [Solution]

Solution:

function solution(S, K) {
	const wordsLen = S.split(' ').map(word => word.length);

	if (wordsLen.some(len => len > K)) return -1;

	const lastIndex = wordsLen.length - 1;
	let currentMessageLen = 0;