Ad
  • Custom User 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 :]

  • Custom User Avatar

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

  • Default User Avatar

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

  • Custom User 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?

  • Default User Avatar

    Fair point, I'll give that a go. Thanks.

  • Custom User Avatar

    translate it to javascript or another popular language.

  • Default User Avatar

    I was recently asked this (https://www.codewars.com/kata/algorithms-interesting-times-in-digital-clock-display) in an interview.
    I authored a Kata for it and I'm trying to get it out of Beta. I googled pretty extensively and couldn't find any other solutions for it.

    Any thoughts or input would be appreciated.