A word and number arrangement machine rearranges an input line step by step, following a rule. Here is an illustration of the input and the steps:
Input: yarn 64 wall bird 67 umbrella 45 66
Step I: 67 yarn 64 wall bird umbrella 45 66
Step II: 67 66 yarn 64 wall bird umbrella 45
Step III: 67 66 64 yarn wall bird umbrella 45
Step IV: 67 66 64 45 yarn wall bird umbrella
Following the same rule, the machine is given this input: year 44 67 rain desk gate 52 20
Which step is the last step for this input?
- A Step VI
- B Step III
- C Step II
- D Step IV Correct
Rule (from the illustration): In each step the largest number not yet arranged moves to the left end, after the numbers already arranged; the words keep their order.
For the new input: Step I: 67 year 44 rain desk gate 52 20; Step II: 67 52 year 44 rain desk gate 20; Step III: 67 52 44 year rain desk gate 20; Step IV: 67 52 44 20 year rain desk gate.
Answer: Step IV
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!