Data Structures & AlgorithmsHardTCS NQT · Accenture

A snail climbs a well of height 10 metres. Each day it climbs 3 metres; each night it slides back 2 metres. It stops when it first reaches or exceeds the top during the day. On which day does it escape?

  1. A. 9
  2. B. 10
  3. C. 12
  4. D. 8

Correct answer: D. 8

Each full day-night cycle nets 1 metre, and the final day climbs 3 metres from 7 metres to reach 10. The last day's climb does not slide back.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic