Java is the future !: backAround

Sunday, October 10, 2010

backAround

You've given a string, take the last char and return a new string with the last char added at the front and back, so "rat" yields "tratt". The original string will be length 1 or more.

backAround("rat") → "tratt"
backAround("cake") → "ecakee"
backAround("x") → "xxx"

Solution :

No comments:

Post a Comment