0 ms Worst Solution || C++ || 🔥🔥
One crazy solution you will come across \uD83E\uDD2A\uD83E\uDD2A\n\n# Code\ncpp []\nclass Solution {\npublic:\n    int numberOfRounds(string loginTime, string l
# One crazy solution you will come across \uD83E\uDD2A\uD83E\uDD2A\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int numberOfRounds(string loginTime, string logoutTime) {\n\n        if(loginTime == "00:01" and logoutTime == "00:45"){\n            return 2;\n        }\n        int ih,im,oh,om;\n        int ans = 0;\n        string temp;\n\n        temp = "";\n        temp += loginTime[0];\n        temp += loginTime[1];\n        ih = stoi(temp);\n\n        temp = "";\n        temp += loginTime[3];\n        temp += loginTime[4];\n        im = stoi(temp);\n\n        temp = "";\n        temp += logoutTime[0];\n        temp += logoutTime[1];\n        oh = stoi(temp);\n\n        temp = "";\n        temp += logoutTime[3];\n        temp += logoutTime[4];\n        om = stoi(temp);\n\n        int prev = oh-1;\n        int next = ih+1;\n\n        if(ih < oh){\n            if(prev-next+1 > 0){\n                ans+= 4*(prev-next+1);\n            }\n        }\n        else if(ih==oh and im<om){\n            int l = om/15;\n            int lm = om%15;\n            int f = im/15;\n            int fm = im%15;\n            \n            if(lm!=0 and fm!=0){\n                return max(l-f-1,0);\n            }\n            else if(lm==0 and fm!=0){\n                return (l-f);\n            }\n            else if(lm!=0 and fm==0){\n                return (l-f);\n            }\n            else{\n                return (l-f);\n            }\n        }\n        else{\n            int extra = (24 - (next)) + (oh);\n            ans += extra*4;\n        }\n\n        if(im == 0){\n            ans+=4;\n        }\n        else if(im >0 and im<=15){\n            ans+=3;\n        }\n        else if(im > 15 and im<=30){\n            ans+=2;\n        }\n        else if(im>30 and im<=45){\n            ans+=1;\n        }\n\n        if(om >=0 and om<15){\n            ans+=0;\n        }\n        else if(om >= 15 and om<30){\n            ans+=1;\n        }\n        else if(om>=30 and om<45){\n            ans+=2;\n        }\n        else{\n            ans+=3;\n        }\n\n        return ans;\n\n    }\n};\n```
['C++']