C++ MyProgrammingLab Problem: We want to create strings with the following patte
ID: 3562373 • Letter: C
Question
C++ MyProgrammingLab Problem:
We want to create strings with the following patterns for n = 1, 2,3,4,5, ...
a
aba
abacaba
abacabadabacaba
abacabadabacabaeabacabadabacaba ...
Define a recursive function
string pattern(int n)
that returns the correct patterns for n = 1,2,3,4,5 and beyond. (Notice the relationship between a given line and the line before it.)
Don't worry about what happens when n gets big or goes beyond 26, you code will only be tested for small values of n.
Avoid needless inefficiencies.