[C++] Simple C++ Code || O(1) time
\n# If you like the implementation then Please help me by increasing my reputation. By clicking the up arrow on the left of my image.\n\nclass Solution {\npubli
\n# **If you like the implementation then Please help me by increasing my reputation. By clicking the up arrow on the left of my image.**\n```\nclass Solution {\npublic:\n    int numberOfRounds(string loginTime, string logoutTime) {\n        int INtime = ((loginTime[0]-\'0\')*10+loginTime[1]-\'0\')*60 + (loginTime[3]-\'0\')*10+loginTime[4]-\'0\';\n        int OUTtime = ((logoutTime[0]-\'0\')*10+logoutTime[1]-\'0\')*60 + (logoutTime[3]-\'0\')*10+logoutTime[4]-\'0\';\n        if(OUTtime < INtime)\n        {\n            OUTtime += 1440;\n        }\n        if(INtime%15 != 0)\n        {\n            int val = INtime/15;\n            INtime = (val+1)*15;  \n        }\n        return abs(OUTtime-INtime)/15;\n    }\n};\n```
['Math', 'C', 'C++']