- 1

HELP SOMEONE☹

The snail climbs up 7 feet each day and slips back 2 feet each night. How many days will it take the snail to get out of a well with the given depth? Sample Input: 31 Sample Output: 6 Explanation: Let's break down the distance the snail covers each day: Day 1: 7-2=5 Day 2: 5+7-2=10 Day 3: 10+7-2=15 Day 4: 15+7-2=20 Day 5: 20+7-2=25 Day 6: 25+7=32 So, on Day 6 the snail will reach 32 feet and get out of the well at day, without slipping back that night

9th Apr 2021, 3:11 PM
Ana Hoxha
Ana Hoxha - avatar
8 odpowiedzi
+ 2
And use relevant tags too
9th Apr 2021, 3:37 PM
Atul [Inactive]
+ 1
Post your attempt first
9th Apr 2021, 3:37 PM
Atul [Inactive]
+ 1
No problem. Your code doesn't consists of the logic part. Please show that
9th Apr 2021, 3:55 PM
Atul [Inactive]
0
Sorry im new
9th Apr 2021, 3:38 PM
Ana Hoxha
Ana Hoxha - avatar
0
function main() { var depth = parseInt(readLine(), 10); //your code goes here
9th Apr 2021, 3:39 PM
Ana Hoxha
Ana Hoxha - avatar
0
Can u slove this for me please i need this today☹
9th Apr 2021, 3:56 PM
Ana Hoxha
Ana Hoxha - avatar
0
THANK YOU!
9th Apr 2021, 3:58 PM
Ana Hoxha
Ana Hoxha - avatar