Skip to content
Discussion options

You must be logged in to vote

The approach can be broken down as follows:

Approach:

  1. Convert time points to minutes:
    Each time point is in "HH:MM" format, so we can convert it into the total number of minutes from 00:00. For example, "23:59" would be 23 * 60 + 59 = 1439 minutes.

  2. Sort the time points:
    Once all the time points are converted into minutes, sort them to calculate the differences between consecutive time points.

  3. Handle the circular nature of the clock:
    The difference between the first and last time points also needs to be considered, because of the circular nature of the clock. This can be handled by adding 1440 (24 hours) to the last time point and comparing it with the first time point.

  4. Find the mi…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mah-shamim
Comment options

mah-shamim Sep 16, 2024
Maintainer Author

@basharul-siddike
Comment options

Answer selected by mah-shamim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested medium Difficulty
2 participants