5 kyu
RegEx Like a Boss #4 CodeGolf : Prime length
111sgerodes
Loading description...
Regular Expressions
Strings
Restricted
Algorithms
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.
Thanks for this kata.
Python, possibly other languages: tests miss sanity checks on values returned by user solution and crash badly when an unexpected value (not a pattern, or not a valid pattern) is returned.
Error messages in final tests seem to be incorrect (actual and expected is switched?):
True. Should be resolved now
Your RegEx has the length 1482. It shoud be not longer than 30.
whileYour RegEx should be not longer than 40 characters
=> ? (maybe make it clear that you're talking about the length of the string because usually, code golf length is checked on the length of the code itself)I removed the VALID and NOT_VALID check from the actual tests. Because the up_to_100 section covers it.
Do you think leaving room for a playground is good? My regex is 19 characters long. Probably it could be stripped to 17. Whats your oppinion about the number 40?
yes, keep some margin about the length. reducing it to something like 20-25 would be more a problem than a feature, imo. Tho, your length check seems to be currently not working: https://www.codewars.com/kata/reviews/5c2cf17c0bf7e200014adacb/groups/5c2dae5b024626000139e2d2
rebuild the codegolf check
not sure this one is really interesting... :/
that would be the simpler/usual way to solve it.
A little bit cheaty...
What if I make a codegolf with a restriction to lets say 20-30 characters? Than your code fails and you must start to think.:P
well, it's not cheaty at all, imo, since it really accomplish te task. ;)
the restriction could be a good way to enforce the thing, yes. That won't be the same level at all, tho. ;)
I dont like hardcoded things. I like when people think with their brains. I dont want a light task.)
that solution is not remotely simple.