You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -914,3 +914,37 @@ ORDER BY location DESC, id;
914
914
---
915
915
916
916
**[⬆ Back to Top](#sql-coding-challenges-for-beginners)**
917
+
918
+
## 31. Growing Plant
919
+
920
+
Each day a plant is growing by `up_speed` meters. Each night that plant's height declines by `down_speed` meters due to the lack of sun heat. Initially, the plant is `0` meters tall. We plant the seed at the beginning of a day. We want to know the number of days that it will take for the plant to reach or pass a desired height (including the last day in the total count). For example,
921
+
- For `up_speed = 100`, `down_speed = 10` and `desired_height = 910`, the output should be `10` days.
922
+
- For `up_speed = 10`, `down_speed = 9` and `desired_height = 4`, the output should be `1` day, because the plant already reaches the desired height on the first day.
0 commit comments