O(1) time complexity, easy to understand, 2 solutions
O(1) time complexity and O(1) space complexity\ncode is self explanatory. Kindly go through it. Incase of any doubts, feel free to comment.\n\n\nclass Solution:
O(1) time complexity and O(1) space complexity\ncode is self explanatory. Kindly go through it. Incase of any doubts, feel free to comment.\n\n```\nclass Solution:\n    def numberOfRounds(self, startTime: str, finishTime: str) -> int:\n\n        start=startTime.split(":")\n        startHour,startMin=int(start[0]),int(start[1])\n        \n        end=finishTime.split(":")\n        endHour,endMin=int(end[0]),int(end[1])\n        # if start time is greater than endtime, calculate round till 00:00 and then till finish time\n        if (startHour>endHour ) or (startHour==endHour and startMin >endMin):\n            return (24-startHour-1)*4+(60-startMin)//15 +self.numberOfRounds("00:00",finishTime)\n        else:\n            if startMin not in [0,15,30,45]:\n                if startMin<15:startMin=15\n                elif startMin<30:startMin=30\n                elif startMin<45:startMin=45\n                elif startHour!=23:\n                    startMin=0\n                    startHour+=1\n                else:\n                    startMin=0\n                    startHour=0\n\n            if endHour==startHour:return (endMin-startMin)//15\n            else:\n                return (endHour-startHour)*4+(endMin-startMin)//15\n        \n```\nSolution 2\n```\nstart=startTime.split(":")\n        startHour,startMin=int(start[0]),int(start[1])\n        startTotalMins=startHour*60+startMin\n        \n        end=finishTime.split(":")\n        endHour,endMin=int(end[0]),int(end[1])\n        endTotalMins=endHour*60+endMin\n\t\t# adding 14 in startMins to neglect rounds which started just after 0,15,30,45 mins\n\t\t# for example "00:01" "00:44" => 44//15-(01+14)//15+0==1\n\t\t# if we don\'t add 14 then round starting from 1 will also be calculated \n        return endTotalMins//15-(startTotalMins+14)//15 + (startTotalMins>endTotalMins)*96\n```
['Math', 'Python', 'Python3']