Resulting call stack

g("ay", 3)  returns "ay"
g("oday", 2)     "oday" + "ay"  returns "odayay"
g("today", 1)    "today" + "odayay"  returns "todayodayay"

Back to Step 5
Back to main solution
Back to 2009 AP CS A MC explanations