fix(challenge): Prevent use of String.repeat() in Basic Algorithm#12930
fix(challenge): Prevent use of String.repeat() in Basic Algorithm#12930systimotic merged 1 commit intofreeCodeCamp:stagingfrom Greenheart:fix/basic-algorithm-prevent-use-of-string-repeat
Conversation
systimotic
left a comment
There was a problem hiding this comment.
I don't know if we ever decided whether to use regex.test(code) or code.match(regex). Not a dealbreaker for this PR though, I think.
Thanks for picking up this ancient issue!
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@systimotic Thanks for the feedback, and pointing me to this issue! I did a quick check and it seems like there's an even distribution between the two methods. I prefer |
systimotic
left a comment
There was a problem hiding this comment.
LGTM 👍
Thanks @Greenheart!
Pre-Submission Checklist
stagingbranch of freeCodeCamp.fix/,feature/, ortranslate/(e.g.fix/signin-issue)npm test. Usegit commit --amendto amend any fixes.Type of Change
Checklist:
Description
Since algorithm challenges aim to help campers practice creating algorithms, we recommended their own solutions over those built into the language. This PR adds a test that prevent the most straight-forward forms of cheating by using
String.repeat().It won't catch all possible ways, but it's better than nothing.