Practice30Create account

A word-and-number arrangement machine rearranges an input line one step at a time. Example — Input: 82 fan 47 ice 15 lamp 63 mug; Step 1: 15 82 fan 47 ice lamp 63 mug; Step 2: 15 47 82 fan ice lamp 63 mug; Step 3: 15 47 63 82 fan ice lamp mug (last step). In each step the smallest remaining number is moved to the front (after the numbers already placed) while the rest keep their order. For the Input: 71 sun 28 rain 55 moon 19 star, what is Step 2?

Competition practiceInput-Output
  • A19 28 55 71 sun rain moon star
  • B19 71 sun 28 rain 55 moon star
  • C19 28 71 sun 55 rain moon star
  • D19 28 71 sun rain 55 moon star

Step-by-Step Solution

Step 1 moves 19 to the front: 19 71 sun 28 rain 55 moon star. Step 2 moves the next smallest, 28, to the front after 19: 19 28 71 sun rain 55 moon star.
Answer: D) 19 28 71 sun rain 55 moon star

Master this topic in 30 minutes a day.

Don't just memorise the answer — build a daily practice habit.

Practice 5 Similar Questions Free →

All Input-Output practice questions

More Input-Output practice

A word-and-number rearrangement machine, given an input line, rearranges it step by…A word-and-number arrangement machine, when given an input line, rearranges it step by…A word-and-number arrangement machine, when given an input line, rearranges it step by…A word-and-number machine rearranges an input line in steps. Input: 'gone 34 far 17 tree…A word-and-number machine rearranges an input line in steps. Input: 'gone 34 far 17 tree…