Auto generation of array(string)

You can start with an Array and build its elements.

Array.tabulate(26)(x => (x+'a').toChar.toString * k)

Or you can start with the elements and then transition to an Array.

('a' to 'z').map(_.toString * k).toArray

Leave a Comment