Reverse Last Two Characters with a Space
Given a string s (assume its length is at least 2), output the last two characters in reversed order with a single space in between.
Example: for "bat", the last two characters are a and t; r...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
