Ad
  • Custom User Avatar

    I'm not sure. I think it depends of the context of the function and that is something to not worry about at this stage.

    If I get picky, there is no documentation or function contract. When I read the given definition of the function, it must do only the maths behind the conversion. It doesn't say that it should validate data, what if I use as input (O, !, 1)?

    The sepecifications of the input constraints makes me interpret them as the function's preconditions. Maybe a special function that validates what a day, hour and minute should look like is in charge of that and that would be a better practice too, isn't it?.

  • Default User Avatar

    I agree with others who are of the opinion that this particular solution cannot be labeled "best practice". The instructions include a limit of <=23 which is not applied in this solution.