6 kyu
Slices of a Series of Digits
314 of 418noku
Loading description...
Algorithms
Data Structures
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.
good one and easy :)
JavaScript tranlstion is avalialbe.
Needs random test cases
Added sample and random tests
I liked this kata: A nice combination of iterating, string operations and working with data types.
However the kata description might be a bit more specific on what kind of error to yield, when … the error condition occurs.
Any error will do.
He's right, be more specific in terms of what error needs to be raised.
Python translation kumited.
Approved
No test cases
Added sample and random tests
The original solution for a totally different kata and your description doesn't describe your tests at all.
But your tests actually seem to expect a format like the following for n=2 [[0, 1], [1, 2], [2, 3], [3, 4]]
Additonally, 'And if you ask for a 6-digit series from a 5-digit string, you deserve whatever you get.' is not sufficient detail for the user to determine that you expect an error to be raised.
Seeing that the previous issue has been open for five days, I've made the following changes to this kata:
The preloaded solution was for a totally different kata. I have replaced it with an empty series_slices method.
Test cases were the wrong way around, I have swapped them: Test.assert_equals(actual, expected, msg = nil) is correct format.
The description incorrectly described the format given in the tests, I have changed this to the following so users know what to return:
I have clarified in the description that if the series is longer than n, an error must be raised.
The "Your solution" section seems to have a default for a completely different kata.
I've changed this as a contributor. Please check and mark as resolved!
resolved