Simple CPP code
Runtime: 0 ms, faster than 100.00% of C++ online submissions for The Number of Full Rounds You Have Played.\nMemory Usage: 5.9 MB, less than 57.14% of C++ onlin
Runtime: 0 ms, faster than 100.00% of C++ online submissions for The Number of Full Rounds You Have Played.\nMemory Usage: 5.9 MB, less than 57.14% of C++ online submissions for The Number of Full Rounds You Have Played.\n\n\n\n```\nclass Solution {\npublic:\n    int numberOfRounds(string startTime, string finishTime) {\n       \n                                                                                                                  \n        int firstMin = (startTime[3] - \'0\') * 10 + (startTime[4] - \'0\');\n        int firstHr = (startTime[0] - \'0\') * 10 + (startTime[1] - \'0\');\n        \n        int lastMin = (finishTime[3] - \'0\') * 10 + (finishTime[4] - \'0\');\n        int lastHr = (finishTime[0] - \'0\') * 10 + (finishTime[1] - \'0\');\n                                                    \n        if(firstMin > 0 && firstMin < 15)\n            firstMin = 15;\n        if(firstMin > 15 && firstMin < 30)\n            firstMin = 30;\n        if(firstMin > 30 && firstMin < 45)\n            firstMin = 45;\n        if(firstMin > 45) {\n             firstMin = 0; firstHr += 1;\n             if(firstHr > 23)\n                 firstHr = 0;\n        }\n                                                    \n                                                    \n        if(lastMin > 0 && lastMin < 15)\n              lastMin = 0;  \n        if(lastMin > 15 && lastMin < 30)\n            lastMin = 15;\n        if(lastMin > 30 && lastMin < 45)\n            lastMin = 30;\n        if(lastMin > 45)\n             lastMin = 45;\n        \n        int firstTime = firstHr * 60 + firstMin;\n        int lastTime = lastHr * 60 + lastMin;\n                                                    \n        int ans = 0;\n                                                    \n        if(firstTime <= lastTime) {\n            ans = (lastTime - firstTime) / 15;\n        }\n        else {\n            ans += (1440 - firstTime) / 15 + (lastTime) / 15;\n        }\n        return ans;\n    }\n};\n```
[]