Algorithm · IBM · Easy
For a string s with at least two characters, print its final pair of characters in reverse sequence, placing exactly one space between them. For instance, with "dog", the trailing characters are o and g; after swapping their order and adding a space, the result is "g o". Input format: A single line provides the string s. Output format: Print one line in the form lastChar + " " + secondLastChar. Constraints: 2 <= len(s) <= 1e5 s can include any visible characters, which must…
Checking your access…