Given a string, return a new string where the first and last chars have been exchanged





Test cases

Test cases Expected Result
frontBack(abcd) dbca OK
frontBack(Bee) eeB OK
frontBack(MazE) EazM OK

Java solution:

Javascript solution:




About the author

Bushan Sirgur

Well, I am Bushan Sirgur from Banglore, India. Currently, I am working as a Software Developer in a Service Base Company. I am interested in JAVA/J2EE, Angular 2, JavaScript, jQuery, MongoDB.

View all posts

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *