-
-
Notifications
You must be signed in to change notification settings - Fork 36.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove global flag from the regex in solution of No Repeats Please
problem
#36377
Comments
Also |
I will take care of this. |
@arshdkhn1 I created the necessary pull request to fix the Guide. Once it is merged, we will still have to wait for the master branch to be deployed to the production site for you to see the change. Thanks for pointing out this issue! |
Describe your problem and how to reproduce it:
The code solution uses global flag in regex, which should not be used unless you really want to use a global flag. The solution works fine, but it is prone to error. Try replacing match with RegExp.test and you ll see the issues that I am talking about.
See - why-does-a-regexp-with-global-flag-give-wrong-results and last baa word not getting filtered for more info.
Add a Link to the page with the problem:
https://guide.freecodecamp.org/certifications/coding-interview-prep/algorithms/no-repeats-please/
The text was updated successfully, but these errors were encountered: