Standard C++ Library User Guide and Tutorial

transform (words.begin(), words.end(),
counts.begin(), words.begin(), stringRepeat);
Transforming the words one, two, three with the values 3, 2, 3 would yield the result
oneoneone, twotwo, threethreethree.