A good night's sleep (retired)
Description:
You have an important meeting tomorrow and need to make sure you receive 8 hours of sleep. Given the current time and the time that you want your alarm to go off as strings, create a function that tells us how long we can solve Katas before bed in hours as an integer, or return -1 if we are going to be tired and receive less than 8 hours sleep.
For example: You want to wake up at 7 am tomorrow. It is currently 6:30 pm. As we know you want to sleep for 8 hours and there is 12.5 hours till the alarm, you can solve kata for 4.5 hours and still wake up refreshed.
The input strings will always be of the form HH:MM for a 24 hour clock. They will only be given on factors of 5 minutes on the hour. e.g. "12:55" but never "12:26". e.g. "02:00" but never "2:00".
If the current time and the alarm time are the same, this means the time for the meeting is now. Why are you trying to sleep?! Go Go!
Good luck.
Similar Kata:
Stats:
Created | Apr 15, 2019 |
Warriors Trained | 45 |
Total Skips | 0 |
Total Code Submissions | 129 |
Total Times Completed | 15 |
JavaScript Completions | 15 |
Total Stars | 3 |
% of votes with a positive feedback rating | 40% of 10 |
Total "Very Satisfied" Votes | 3 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 11 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |