You need to decode a string:
- If the string's first symbol is
i, remove the first symbol. The string will contain a number. Add 1 to the number and print it. - If the string's first symbol is
s, remove the first symbol. Then print the reversed remainder. - If otherwise, print the unchanged string.
Here are string functions that you can use:
.first()returns thefirstsymbol of the string..isEmpty()returnstrueif the string has no symbols, otherwise, it returnsfalse..drop(n)removesnfirst symbols from the string and returns the resulting string..reversed()returns the reversed string..toInt()converts the string to an integer and returns it.
You should output the results using the println function.
You may read about characters in our topic. Advanced string operations are covered here. However, the above functions should be enough to solve this problem.