+1 vote

First, we are assuming alarm time is after actual time if we need to find the number of minutes until the alarm rings.

Let's assume the actual time is 625 and the alarm time is 805. The difference is 100 minutes, but that isn't 805 - 625. How can the 100 minutes be calculated?

Here's one stategy:

Convert each time to the number of minutes since midnight:

625 = 6 * 60 + 25 = 385 minutes
805 = 8 * 60 + 5 = 485 minutes

Then subtract:

485 - 385 = 100 minutes

To get the 6 and 25 "separated" from 625 think about // and %.