Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Here is the following prompt: /*flipEachK should take a String and an int as input and returns a String. Let k be the name of the input integer.

Hey! Here is the following prompt: /*flipEachK should take a String and an int as input and returns a String. Let k be the name of the input integer. The output string should contain the first k characters of the input string in order, the next k characters of the input string in reverse order, the next k characters of the input string in normal order,  and so on. The output string should have all the characters of the input string and no others. flipEachK("abcdefghijklmn", 4) should return "abcdhgfeijklnm"*/ I am confused on a lot of different aspects of this prompt. Firstly, I am unclear on how to group indexs by a variable as in divide them by this k value. From there, I know you can use string builder to establish a new string and reverse it, but I don't know how to do that without the reverse command, which I think it what is expected... Help would be much appreciated!

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question