Practice30Create account

A machine handles both words and numbers each step: the word earliest in alphabetical order moves to the leftmost free position and, at the same time, the largest number moves to the rightmost free position; the remaining items keep their relative order. Example - Input: '25 bat 60 ace 40'. Step I: 'ace 25 bat 40 60'. Step II: 'ace bat 25 40 60'. For the input '18 sun 45 den 30 cot', which line is Step II?

Competition practiceInput-Output
  • Acot den 18 sun 45 30
  • Bden cot 18 sun 30 45
  • Ccot den 18 sun 30 45
  • Dcot 18 den sun 30 45

Step-by-Step Solution

Step I sends 'cot' (earliest word) left and 45 (largest number) right: 'cot 18 sun den 30 45'. Step II sends 'den' to the next left slot and 30 to the next right slot: 'cot den 18 sun 30 45'.
Answer: C) cot den 18 sun 30 45

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 machine rearranges words in steps; each step moves the earliest-in-dictionary…A machine rearranges numbers in steps; each step moves the smallest not-yet-arranged…A machine rearranges numbers in steps; each step moves the largest not-yet-arranged…A machine rearranges words into reverse dictionary order (Z to A); each step moves the…A machine arranges numbers in ascending order from the left; each step moves the…