Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The same task with different starting and ending times would need to give those times as argument.
The question is then what format use? Integer hour, Integer minutes, String, ... ?
There's no point in making a function for any start and end when there's no specification about it, you would most likely have to rework the thing anyway.
The function takes barely 1 or 2 minutes to write, if it has to be remake you didn't lose much.
But if you write it to work as you said and the specification doesn't change then you lost way more time.
This can be upvoted for "Best Practices" only when the numbers of hours tracked is low. Let's say we get the same task, but with 24 hours tracking, this type of code becomes pretty bad.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution