Write a function to capitalize the first and last letters of each word in a string.
MediumProblem Statement
Write a function to capitalize the first and last letters of each word in a string.
Sample Input
"hello world"
Sample Output
HellO WorlD
Limits
Time: 2s · Memory: 256 MB