Ad
  • Custom User Avatar

    I've modifed the descrption like this:

    • #Example

    For upSpeed = 100, downSpeed = 10 and desiredHeight = 910, the output should be 10.

    After day 1 --> 100
    After night 1 --> 90
    After day 2 --> 190
    After night 2 --> 180
    After day 3 --> 280
    After night 3 --> 270
    After day 4 --> 370
    After night 4 --> 360
    After day 5 --> 460
    After night 5 --> 450
    After day 6 --> 550
    After night 6 --> 540
    After day 7 --> 640
    After night 7 --> 630
    After day 8 --> 730
    After night 8 --> 720
    After day 9 --> 820
    After night 9 --> 810
    After day 10 --> 910 
    

    For upSpeed = 10, downSpeed = 9 and desiredHeight = 4, the output should be 1.

    Because the plant reach to the desired height at day 1(10 meters).

    After day 1 --> 10