Beats 100% || Simple Taught
\n\n# Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n-
![Screenshot (156).png](https://assets.leetcode.com/users/images/534a8b02-27fb-47d7-8319-30c10f49e592_1713533992.7405508.png)\n\n# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public static int fn(int y,int x){\n        int sum=0;\n        while(y!=x){\n            sum+=4;\n            ++y;\n            if(y==24)\n            y=0;\n        }\n        return sum;\n    }\n    public int numberOfRounds(String li, String lo) {\n       int y=Integer.parseInt(li.substring(0,2));\n       int x=Integer.parseInt(lo.substring(0,2));\n       int sum=0;\n        sum=fn(y,x);\n       int yy=Integer.parseInt(li.substring(3,5));\n       int xx=Integer.parseInt(lo.substring(3,5));\n       if(x==y && xx<yy)\n       sum=96;\n       if(yy!=0)\n        if(yy<=15)\n        --sum;\n        else if(yy<=30)\n        sum-=2;\n        else if(yy<=45)\n        sum-=3;\n        else\n        sum-=4;\n       if(xx!=0)\n       if(xx>=45)\n       sum+=3;\n       else if(xx>=30)\n       sum+=2;\n       else if(xx>=15)\n       sum+=1;\n        return Math.max(0,sum);\n    }\n}\n```
['String', 'Java']