I think it comes with balance. If your goal is to land a role and doing leetcode problems is how you can land one, then its best to set time for yourself to tackle these problems while making time for other things to prevent burnout. The definition of discipline isn't to just sit there working on a problem for hours and hours, its about getting the job done regardless of how much time it takes. How fast you want it done depends on how strong your desire is to reach your goal.