PIXELBANKv8.2.1
Menu

Word Reverser

Given a sentence, reverse each word individually while keeping the word order the same.

Example:

  • Input: "hello world"
  • Reversed words: "olleh dlrow"

Words are separated by single spaces. Preserve the original casing of each character.

Example:

Input:
hello world
Output:
olleh dlrow
Reasoning:

Step 1: Split into words ["hello", "world"]

Step 2: Reverse each word "hello" → "olleh" "world" → "dlrow"

Step 3: Join with spaces "olleh dlrow"

Constraints:

  • Input: A single line of text
  • Words are separated by single spaces
  • Output: Each word reversed, space-separated
  • Preserve original character casing
Editor

Test Results

0/0
Run code to see test results.