Intuitive solution with comments
IntuitionConvert time to minutes and calculateApproachComplexity
Time complexity:
O(1)
Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Convert time to minutes and calculate

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
$$O(1)$$

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int numberOfRounds(String loginTime, String logoutTime) {
        //convert time to mins
        int login = timeToMins(loginTime);
        int logout = timeToMins(logoutTime);
        
        // find first game start time
        int start = login;
        while(start % 15 != 0) {
            start++;
        }

        // find last game end time
        int end = logout;
        while(end % 15 != 0) {
            end--;
        }

        // if login < logout (get difference)
        // else get diff to/from 00:00
        if(login < logout) {
            if(start > end) {
                return 0;
            }
            return (end - start)/15;
        } else {
            int day1 = (1440 - start)/15;
            int day2 = end/15;
            return day1 + day2;
        }
        
    }

    int timeToMins(String time) {
        String[] arr = time.split(":");
        int hour = Integer.valueOf(arr[0]);
        int min = Integer.valueOf(arr[1]);
        return (hour * 60) + min;
    }
}
```
['Java']