Question 1
Input: butterfly rat ant dog elephant
Step 1: ant dog rat
Step 2: ant dog rat elephant
Rule: Arrange words by length (shortest first), then alphabetically for same length.
What is the final output?
Sorted by word length: ant dog rat elephant butterfly