#Problem in java

7 messages · Page 1 of 1 (latest)

weak haven
#

Basically u can assume the input is given but im unsure what to really do

#

actually i dont get it

narrow sable
#

String str is the word that is given to you (in this case "Hello", and n a number. This number represents a substring from the right side of the word and the amount of times it is to be repeated and then printed.

#

You can see that for "Hello" and 1, you are supposed to take the right most character and print it once

#

For "Hello" and 2, you are supposed to take the two right most characters and print them twice

#

Lets say you are given "Hello" and 4, can you guess what the output would be?
|| elloelloelloello - Why? Because its the 4 characters from the far right of the word repeated 4 times ||

#

@weak haven In case you need more help, just ping me and Ill try to explain it in more detail. The code itself shouldnt be more than 5 lines either.