100% beats
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 
# 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:O(1)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n        int targetsec=targetSeconds/60;\n         int time=targetSeconds%60;\n         if(targetsec==100){\n            targetsec=targetsec-1;\n            time+=60;\n         }\n         \n\n        int mincost=1000000;\n        int i=2;\n        while(i>0){\n            if(targetsec==100){\n                i--;\n                continue;\n            }\n            int mincost1=0;\n        if(targetsec==0){\n           \n            int moves=0;\n            int pushes=0;\n            if(time>=10){\n                moves=2;\n            moves-=time/10==startAt?1:0;\n            moves-=time/10==time%10?1:0;\n             pushes=2;\n            }\n            else{\n            moves=time%10==startAt?0:1;\n            pushes=1;\n            }\n            \n                mincost1=pushes*pushCost+moves*moveCost;\n                if(time>=60){\n                    targetsec=1;\n                    time=time%60;\n\n                }\n                else{\n                    \n                    i--;\n                }\n        }\n        else if(targetsec>=1){\n            \n            int moves=0;\n            int pushes=0;\n            if(targetsec>=10){\n                moves=4;\n            }\n            else{\n                moves=3;\n            }\n                if(targetsec<10){\n                    moves-=targetsec==startAt?1:0;\n                }\n                else{\n                    moves-=targetsec/10==startAt?1:0;\n                    moves-=targetsec/10==targetsec%10?1:0;\n                }\n                \n                if(time<10){\n                    moves-=targetsec%10==0?1:0;\n                    moves-=time==0?1:0;\n                }\n                else{\n               moves-=targetsec%10==time/10?1:0;\n                moves-=time/10==time%10?1:0;\n                }\n\n                pushes=targetsec<10?3:4;\n            if(time<=39){\n               \n                targetsec-=1;\n                time=time+60;\n            }\n            else if(time>=60){\n                targetsec+=1;\n                time=time-60;\n            }\n            else{\n                i--;\n            }\n            \n             mincost1=pushes*pushCost+moves*moveCost;\n             \n        }\n        mincost=Math.min(mincost,mincost1);\n        i--;\n        }\n        return mincost;\n    }\n}\n```
['Java']