1
var numberOfRounds = function (loginTime, logoutTime) {
2
const start = toMins(loginTime);
3
const end = toMins(logoutTime);
4

5
let roundStart = Math.ceil(start / 15);
6
let roundEnd = Math.floor(end / 15);
7

8
if (start < end) {
9
return Math.max(0, roundEnd - roundStart);
10
} else {
11
roundEnd += 96;
12
return roundEnd - roundStart;
13
}
14

15
function toMins(timeStr) {
16
const [hh, mm] = timeStr.split(":");
17

18
let totMins = 0;
19

20
totMins += parseInt(hh) * 60;
21
totMins += parseInt(mm);
22

23
return totMins;
24
}
25
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0