You read too much into it. When it says "input constraints" it doesn't mean you need to verify the inputs fall into that range. It means that all test case inputs to the function you create will fall into those ranges.
I don't need to verify that h hours will be greater than or equal to 0 and less than or equal to 23 when the contraints tell me the input will be 0 <= h <= 23.
It has two lines of code less than mine
This comment is hidden because it contains spoiler information about the solution
Probably the best solution.
Well I got that one wrong for sure.
Yeah I misunderstood the requirements.
You read too much into it. When it says "input constraints" it doesn't mean you need to verify the inputs fall into that range. It means that all test case inputs to the function you create will fall into those ranges.
I don't need to verify that h hours will be greater than or equal to 0 and less than or equal to 23 when the contraints tell me the input will be 0 <= h <= 23.
This is also incorrect. Needs to take constraints into account.
It'd work anyways.
also, read the comments!
This comment is hidden because it contains spoiler information about the solution
Exactly how I did it :)
This comment is hidden because it contains spoiler information about the solution
i like this solution cleaner and clear
Thanks!
This comment is hidden because it contains spoiler information about the solution
Loading more items...