← 返回 doordash 的题目列表Generate Time Intervals for Notifications
类型:online_judge
Develop a function to generate a list of time intervals for sending notifications by a delivery platform during the store's open hours. The times should be generated every 5 minutes.
Input Format
openTime (str): Store's opening time in the format "xxx xx:xx xx".
closeTime (str): Store's closing time in the format "xxx xx:xx xx".
Output Format
Return a list containing all notification times as strings, in the format "dHHMM", where d is the day of the week (1-7), HH is the hour (00-23), and MM is the minute (a multiple of 5 between 00 and 59).
Examples
Example 1:
openTime = "mon 10:01 am", closeTime = "mon 10:10 am"
Output: ["11000", "11005", "11010"]
Example 2:
openTime = "sat 11:01 pm", closeTime = "sat 11:10 pm"
Output: ["62300", "62305", "62310"]
Example
Input
mon 10:01 am
mon 10:10 am