Let's test your knowledge. Click the correct answer from the options.

What will the following pseudocode do to an input string?

1func reverseStr(str string) string {
2    strCopy := []rune(str)
3    start := 0
4    end := len(str) - 1
5    for start < end {
6        strCopy[start], strCopy[end] = strCopy[end], strCopy[start]
7        start++
8        end--
9    }
10    return string(strCopy)
11}

Click the option that best answers the question.

  • Make a copy
  • Reverse the string
  • Swap the first and last letters
  • Infinite loop
OUTPUT
Results will appear here.