Minimum Number of Operations to Convert Time Problem
Minimum Number of Operations to Convert Time Problem — ExecCode Easy DSA Practice
Solve the Minimum Number of Operations to Convert Time problem on ExecCode. Free online easy DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given two strings current and correct representing two 24-hour times. Your task is to compute the required answer and return the minimum number of operations needed to convert current to correct. 24-hour times are formatted as "HH:MM", where HH is between 00 and 23, and MM is between 00 and 59. The earliest 24-hour time is 00:00, and the latest is 23:59. In one operation you can increase the time current by 1, 5, 15, or 60 minutes. You can perform this operation any number of times.
Examples
Input {"current": "02:30", "correct": "04:35"}; Output 3. Input {"current": "11:00", "correct": "11:01"}; Output 1
Constraints
current and correct are in the format "HH:MM" current <= correct
Practice Minimum Number of Operations to Convert Time free on ExecCode. Browse DSA problems, topic map, and placement guides.