5 kyu
Finite automation 2: NFA Runner
35aland97
Loading description...
Fundamentals
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.
approve or feedback?
Edit: there is no consensus yet on the difficulty level. we need more solvers ..
Perhaps more users will be interested if you'd have a translation to either Ruby or Python. Would you consider adding such translation?
Btw in sample (maybe full tests?) you have a typo.
Shold
->Should
solved typo and approved at 5 kyu
The link to the 3th chapter of this series points to the 1st one.
oops, fixed)
missing fixed test: something like the following:
my solution fails often, but not on every run of the random tests (note: I don't know the expected result there, because my code ends up in a recursion error)
add some fixed tests. But may be use stack for dfs, or using something else.
(no, it's not because of the stack/recursion, I have a flaw in the logic and my code goes into an equivalent of an infinite loop, actually)
I tried to find cases when this happens, but to no avail
i find this case, check out last fixed test
The expected result is false, since the end states are 4, 9, 3, 8, 1, which does not include 0.
Hi,
X tests on a new NFA
or something like that.it
blocks of the random tests. 'Would be better to have a separate function (defined in the describe block, but not right inside the for loop) that you call with the appropriate arguments. This way, the tests will be easier to maintain by others.note: in the logs:
Hi, rewrote the tests, removed the logs, and added the number of strings to the title of the it block
also transferred the code from loops to separate functions
Hi again,
cheers
note that the fact that no concrete inputs are clearly standing out in the sample tests really doesn't help the user to sort out what's going on.
tests improved
added to the description, an example of the input data with explanations
can i resolve issue?
yup
See question below. Why this many tests? Is this an extreme performance kata?
reduced to ~1000
How many tests do you have? I'm timing out after 123,000 tests. Perhaps you should add a "performance" tag.
The other kata has 200,000 tests and here it's probably the same. This really should be an issue because having so many tests is unreasonable.
reduced to ~1000