Practice30Create account

A number-arranging machine rearranges an input line of numbers step by step. Example — Input: 62 34 89 17 45 23; Step 1: 17 62 34 89 45 23; Step 2: 17 23 62 34 89 45; Step 3: 17 23 34 62 89 45; Step 4: 17 23 34 45 62 89 (last step). In each step the next-smallest number is moved to the leftmost not-yet-fixed position, the others keeping their order. In the last step for the input '55 28 71 39 84 16', which number is third from the left?

Competition practiceInput-Output
  • A28
  • B55
  • C39
  • D71

Step-by-Step Solution

The final arrangement is 16 28 39 55 71 84. The third number from the left is 39.
Answer: C) 39

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 number-arrangement machine, given an input row of numbers, rearranges it in steps. In…A number-arrangement machine, given an input row of numbers, rearranges it in steps. In…A word-arrangement machine, given an input row of words, rearranges it in steps. In each…A word-arrangement machine, given an input row of words, rearranges it in steps. In each…A number-arranging machine rearranges a set of numbers. In each step it fixes one more…