Array of Strings From a Pattern

You are given a string containing single digit integers followed by one more letters as an argument. Interpret the string as a pattern. The integer leading the character will determine how many times that character or series of characters should be repeated as a string. Return an array of strings as specified by the "pattern."


  • Must return an array of strings

Example #1

> ["a", "a", "a", "z", "z", "c", "c", "c"]

Example #2

> ["abc", "abc", "xyz"]