Problem 288. Construct a string from letters and counts

Given two input arrays like this: [5,3,1] ['a','b','c']

Output a string that contains each letter the specified number of times, e.g.:


If given an invalid input (for example, a negative number), output the string 'ERROR'.

Solution Stats

34.89% Correct | 65.11% Incorrect
Last solution submitted on Oct 07, 2016

Problem Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more