Question 1
Input: hello world madam level coding
Step 1: Palindromic words (read same forwards/backwards): level madam
Step 2: Non-palindromic words: coding hello world
Step 3: Combine (palindromes first, then others, each sorted alphabetically): level madam coding hello world
What is the final output?
Palindromic words first (alphabetically sorted), then non-palindromic words (alphabetically sorted): level madam coding hello world