Given a word word, return it said with a stutter: its first two characters, then a hyphen -, then the whole word.
Example 1:
Input: word = "dog" Output: "do-dog" Explanation: The first two characters are "do". After them come a hyphen and the whole word, "dog".
Example 2:
Input: word = "Hello" Output: "He-Hello" Explanation: The characters keep their case: the stutter starts with an upper-case H, as the word does.
Example 3:
Input: word = "ab" Output: "ab-ab" Explanation: A word with only two letters: its first two characters are the whole word.
Constraints:
wordhas at least 2 letters.wordis made of English letters only, lowercase or uppercase: no spaces, digits or punctuation.
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check
