Skip to content

Instantly share code, notes, and snippets.

@romabelka
romabelka / taskt-example.md
Created October 1, 2019 08:41
Kickstart testing example

You have a long piece of text, and you want to send it to your friend as a series of SMS messages. Your text consists of English letters (uppercase and lowercase) and spaces. The text doesn't contain any leading spaces at the beginning or trailing spaces at the end. There are no two consecutive spaces in the text.

One proper SMS can contain at most K characters. If the text is longer, it needs to be split into parts. Each part should be sent in a separate message that fulfills the maximum length requirement. Text may not be split within words. The order of the words and the messages can't change, so that we can later concatenate the resulting messages to retrieve the original text. Spaces at the start and end of all messages are removed, and thus are not accounted for in the overall message length.

The goal is to count the number of SMS messages needed to accommodate the whole text, keeping the length of each message less than or equal to K. The total number of SMS messages must be kept to a minimum, ho