Practice30Create account

A number-arranging machine rearranges an input line of numbers using one rule at each step: the next-lowest number is moved into its final sorted position from the left, and the remaining numbers shift one place to the right keeping their order. Example — Input: 35 16 42 8 23 19; Step I: 8 35 16 42 23 19; Step II: 8 16 35 42 23 19; Step III: 8 16 19 35 42 23; Step IV: 8 16 19 23 35 42 (last step). For the Input: 48 21 9 63 30, how many steps are needed to reach the final arrangement?

Competition practiceInput-Output
  • A3
  • B4
  • C2
  • D5

Step-by-Step Solution

Step I: 9 48 21 63 30; Step II: 9 21 48 63 30; Step III: 9 21 30 48 63 (now fully sorted). Three steps are needed.
Answer: A) 3

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 arrangement machine, given an input line, rearranges it in steps. In…A word-and-number arrangement machine, given an input line, rearranges it in steps. In…A word-arrangement machine rearranges an input line of words in steps. Input: 'tree…A rearrangement machine, given an input line, arranges all words in alphabetical order…A rearrangement machine moves, in each step, the smallest number not yet in place to the…