Go O(1) time calculation
Intuition\nEach game will start at quarter interval of an hour, then in total minutes it will be divisable by 15\n\nIf login time not fitted to a quarter interv
# Intuition\nEach game will start at quarter interval of an hour, then in total minutes it will be divisable by 15\n\nIf login time not fitted to a quarter interval, then we need to add-up to next interval start\n\nIf we slip to the next day, just add the the previous full day to the next day to calculate difference\n\n# Approach\n- Parse the time to minutes\n- Calculate how many minutes must be added to match next game time\n- Take two cases and for each apply logic\n\n# Complexity\n- Time complexity:\n$$O(1)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```golang []\nfunc numberOfRounds(loginTime string, logoutTime string) int {\n    loginM := timeSigToMinutes(loginTime)\n    logoutM := timeSigToMinutes(logoutTime)\n\n    // 65 minutes = 01:05\n    // Next game will happen 01:15\n    // 65 % 15 = 5 \n    intervalDiff := loginM % 15\n    if intervalDiff > 0 {\n        intervalDiff = 15 - intervalDiff\n    }\n\n    if loginM < logoutM {\n        nextGameStart := loginM + intervalDiff\n        return (logoutM - nextGameStart) / 15\n    } else {\n        // Case when we slip over the day\n        nextGameStart := loginM + intervalDiff\n        return (logoutM + 1440 - nextGameStart) / 15\n    }\n}\n\nfunc timeSigToMinutes(sig string) int {\n    hr := ((int(sig[0]) - 48) * 10) + (int(sig[1]) - 48)\n    mi := ((int(sig[3]) - 48) * 10) + (int(sig[4]) - 48)\n    return hr * 60 + mi\n}\n```
['Go']