Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 533 Bytes

59-snail-crawls-up.md

File metadata and controls

11 lines (10 loc) · 533 Bytes

Problem:

The snail crawls up the column. During the day it crawls up some distance. During the night she sleeps, so she slides down for some distance (less than crawls up during the day).

Your function takes three arguments:

  1. The height of the column (meters)
  2. The distance that the snail crawls during the day (meters)
  3. The distance that the snail slides down during the night (meters)

Calculate number of day when the snail will reach the top of the column.

Solution