Retired
Algorithms: Interesting times in Digital Clock display (retired)
14dloomb
Loading description...
Algorithms
Strings
Data Types
Logic
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
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 :]
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 returns504
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?
Yes, you are quite right. My solution allowed duplicates. I have updated my solution and the tests. Thanks for pointing that out.
Thanks I should've asked earlier but wasn't confident enough with my solution at the time. I'll try again later :)