Problem Brief
Last and Second-Last
FULLTIMEOA
Given a string, create a new string made up of its last two letters, reversed and separated by a space.
Function Description
Complete the function lastLetters in the editor below.
lastLetters has the following parameter(s):
string word: a string to process
Returns
string: a string of two space-separated characters
1Example 1
Input
word = "APPLE"
Output
"E L"
Explanation
The last letter in 'APPLE' is E and the second-to-last letter is L, so return E L.
2Example 2
Input
word = "bat"
Output
"t a"
Explanation
Just an example provided by Oracle with no explanation 🥲🔫
Constraints
Limits and guarantees your solution can rely on.
2 ≤ length of word ≤ 100