Learn
0 day streak

0 of 56 answered today

Clears at midnight
StringsEasy

Building a string with +

repeatChar builds a string of n copies of c. What's the time complexity in terms of n?

string repeatChar(char c, int n) {    string s;    for (int i = 0; i < n; ++i) {        s = s + c;    }    return s;}

Pick with 1–4 or A–D. Once you answer, every choice is explained.