c++ | taking care for first and last hour , remaining hours contribute 4
\nclass Solution {\npublic:\n    int first(int m){\n        if(m>45)return 0;\n        if(m>30)return 1;\n        if(m>15)return 2;\n        if(m>0)return 3;\n 
```\nclass Solution {\npublic:\n    int first(int m){\n        if(m>45)return 0;\n        if(m>30)return 1;\n        if(m>15)return 2;\n        if(m>0)return 3;\n        return 4;\n    }\n    int last(int m){\n        if(m<15)return 0;\n        if(m<30)return 1;\n        if(m<45)return 2;\n        if(m<60)return 3;\n        return 4;\n    }\n    int numberOfRounds(string st, string ft) {\n        int h1 = (st[0]-\'0\')*10+(st[1]-\'0\');\n        int m1 = (st[3]-\'0\')*10+(st[4]-\'0\');\n        \n        int h2 = (ft[0]-\'0\')*10+(ft[1]-\'0\');\n        int m2 = (ft[3]-\'0\')*10+(ft[4]-\'0\');\n        \n        int ans = 0;\n        if(h1>h2 || (h1==h2 && m1>m2)){\n            h2 = (h2+24);\n        }\n        if(h2>h1){\n            ans = (h2-h1-1)*4;\n            ans+=first(m1)+last(m2);\n        }else{\n            if(m1 <= 0 && m2 >= 15)ans++;\n            if(m1 <= 15 && m2 >= 30)ans++;\n            if(m1 <= 30 && m2 >= 45)ans++;\n        }\n        return ans;\n    }\n};\n```
['C', 'C++']