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.
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 :]
Thanks
I should've asked earlier but wasn't confident enough with my solution at the time.
I'll try again later :)
Yes, you are quite right. My solution allowed duplicates. I have updated my solution and the tests. Thanks for pointing that out.
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
and23:59:59
inclusive.My solution returns
504
00
,11
,22
have88
each06
,07
,08
,09
,16
,17
,18
,19
have4
each16
each88*3 + 4*8 + 16*13 = 504
Am I misunderstanding something?
Fair point, I'll give that a go. Thanks.
translate it to javascript or another popular language.
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.