Question
Write the function that takes one parameter, a non-empty String str (such as Code) and returns a String in the form CCoCodCode. Notice that this
Write the function that takes one parameter, a non-empty String str (such as "Code") and returns a String in the form "CCoCodCode". Notice that this includes the first character of the original String, followed by the first twocharacters, and so on until the whole String is used.
Here are some examples:
stringSplosion("Code") returns "CCoCodCode"
stringSplosion("abc") returns "aababc"
stringSplosion("x") returns "x"
I believe the for condition is ( int i = 0 ; i < len ; i++), but I don't know how to continue.
Please use a for loop and if you can explain cause I'm a beginner
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started