Retired

Algorithms: Interesting times in Digital Clock display (retired)

Description
Loading description...
Algorithms
Strings
Data Types
Logic
  • Please sign in or sign up to leave a comment.
  • kazk Avatar

    I decided not to vote at this point, just leaving some feedbacks for now :)

    Needs more tests for correctness and performance. If tested more thoroughly, the error in your solution would've been caught before publishing and will prevent incorrect solutions to pass in the future. As for performance, I assumed checking every combination will timeout, but apparently not. If this is what you want, ignore the performance aspect.

    Include random tests. As far as I know, the main purpose of random tests on CodeWars is to prevent cheating. I think random tests are also useful to catch some errors, but only if it's reproducible and/or have good feedback. I don't really care about people cheating, but others do and expects katas to have random tests.

    Why are inputs inout String? Seems unnecessary because there's no reason to mutate input strings, but I may be missing something as I don't know much Swift.

    I don't think I can help you further, but I hope my feedbacks are useful :]

  • kazk Avatar

    I've had a solution passing everything except for "Full Range Test" since the day you published. I noticed that no one has completed after 2 weeks so I wanted to make sure tests are correct.

    "Full Range Test" asks for number of interesting times between 00:00:00 and 23:59:59 inclusive. My solution returns 504

    • hours 00,11,22 have 88 each
    • hours 06,07,08,09,16,17,18,19 have 4 each
    • other hours have 16 each
    • 88*3 + 4*8 + 16*13 = 504

    Am I misunderstanding something?

    • dloomb Avatar

      Yes, you are quite right. My solution allowed duplicates. I have updated my solution and the tests. Thanks for pointing that out.

      Question marked resolved by dloomb 8 years ago
    • kazk Avatar

      Thanks I should've asked earlier but wasn't confident enough with my solution at the time. I'll try again later :)