Practice30Create account

A word-and-number arrangement machine, when given an input line of words and numbers, rearranges it in steps. In each step the rightmost unshifted word of five letters or more is taken out and placed at the extreme right end of the line. Words of fewer than five letters, and all the numbers, are never shifted; every other element keeps its relative position, and the machine stops when no such word is left.
Input: neem 63 banyan 27 mandir 48 tulsi ghat 35.
Which of the following is Step 2 of the above arrangement?

Competition practiceInput-Output
  • Aneem 63 banyan 27 mandir 48 ghat 35 tulsi
  • Bneem 63 banyan 27 48 ghat 35 tulsi mandir
  • Cneem 63 27 48 ghat 35 tulsi mandir banyan
  • Dneem 63 27 48 tulsi ghat 35 banyan mandir

Step-by-Step Solution

Words of five letters or more are banyan, mandir and tulsi; neem and ghat are too short. They are taken rightmost first. Step 1 moves tulsi: neem 63 banyan 27 mandir 48 ghat 35 tulsi. Step 2 moves mandir: neem 63 banyan 27 48 ghat 35 tulsi mandir, the answer. "neem 63 banyan 27 mandir 48 ghat 35 tulsi" is Step 1 and "neem 63 27 48 ghat 35 tulsi mandir banyan" is Step 3, the last step. "neem 63 27 48 tulsi ghat 35 banyan mandir" takes the long words leftmost first instead of rightmost first.
Answer: B) neem 63 banyan 27 48 ghat 35 tulsi mandir

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 works on an input line of words and two-digit…A word-and-number arrangement machine works on an input line of words and two-digit…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…