You can just subtract 2 times in a clever way but I suggest a easier approach. We can take the first time and keep adding 1 minute to the first time's minute and count how many we added before we reach the second time. Also we need to keep in mind that when minute reaches 60 it becomes 0 and hour increases by 1 and if hour reaches 24 then hour turn into 0.
No comments:
Post a Comment