C++ | Long but easy to understand
\nclass Solution {\npublic:\n    int numberOfRounds(string startTime, string finishTime) {\n        int start_hh = stoi(startTime.substr(0,2));\n        int sta
```\nclass Solution {\npublic:\n    int numberOfRounds(string startTime, string finishTime) {\n        int start_hh = stoi(startTime.substr(0,2));\n        int start_mm = stoi(startTime.substr(3,2));\n        \n        int end_hh = stoi(finishTime.substr(0,2));\n        int end_mm = stoi(finishTime.substr(3,2));\n        \n        std::function<void(int,int)> roundIt = [&](int hh, int mm){\n            if(1<=mm && mm<15){\n                start_mm=15;\n            }\n            else if(15<mm && mm<30){\n                start_mm=30;\n            }\n            else if(30<mm && mm<45){\n                start_mm=45;\n            }\n            else if(45<mm && mm<=59){\n                start_mm=00;\n                if(start_hh==23){\n                    start_hh=0;\n                }\n                else{\n                    start_hh++;\n                }\n            }\n        };\n        \n        std::function<void()> move = [&](){\n            if(start_hh==23){\n                if(start_mm==0){\n                    start_mm+=15;\n                }\n                else if(start_mm==15){\n                    start_mm+=15;\n                }\n                else if(start_mm==30){\n                    start_mm+=15;\n                }\n                else if(start_mm==45){\n                    start_mm=0;\n                    start_hh=0;\n                }\n            }\n            else{\n                if(start_mm==0){\n                    start_mm+=15;\n                }\n                else if(start_mm==15){\n                    start_mm+=15;\n                }\n                else if(start_mm==30){\n                    start_mm+=15;\n                }\n                else if(start_mm==45){\n                    start_mm=0;\n                    start_hh++;\n                }\n            }\n        };\n        \n        int cnt = 0;\n        \n        if(start_hh<end_hh){\n            roundIt(start_hh,start_mm);\n            if(start_hh==end_hh){\n                while((end_mm-start_mm)>=15){\n                    move();\n                    cnt++;\n                }\n            }\n            else{\n                while(start_hh<end_hh){\n                    move();\n                    cnt++;\n                }\n                while((end_mm-start_mm)>=15){\n                    move();\n                    cnt++;\n                }\n            }\n        }\n        else if(start_hh==end_hh && start_mm<end_mm){\n            roundIt(start_hh,start_mm);\n            if(start_mm>=end_mm)\n                return 0;\n            while((end_mm-start_mm)>=15){\n                move();\n                cnt++;\n            }\n        }\n        else if(start_hh==end_hh && start_mm==end_mm){\n            return 96;\n        }\n        else if(start_hh==end_hh && start_mm>end_mm){\n            roundIt(start_hh,start_mm);\n            while((start_hh!=0)||(start_mm!=0)){\n                // cout<<start_hh<<" "<<start_mm<<endl;\n                move();\n                cnt++;\n            }\n            while(start_hh<end_hh){\n                move();\n                cnt++;\n            }\n            while((end_mm-start_mm)>=15){\n                move();\n                cnt++;\n            }\n        }\n        else if(start_hh>end_hh){\n            roundIt(start_hh,start_mm);\n            while((start_hh!=0)||(start_mm!=0)){\n                move();\n                cnt++;\n            }\n            while(start_hh<end_hh){\n                move();\n                cnt++;\n            }\n            while((end_mm-start_mm)>=15){\n                move();\n                cnt++;\n            }\n        }\n        \n        return cnt;\n    }\n};\n```
[]