-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
URLify.py #6
Comments
Yours is also a valid solution and it works, but the question asks for an in-place solution. That's why we used a character array (like the book suggests), and not a separate string. |
I was actually going to post, i just saw that the unit test does use a character array. thanks. |
This isn't the first time a non-in-place solution has been suggested as a replacement for this solution. See careercup/CtCI-6th-Edition#31. |
PHP Solutions & Unit Tests for Questions 2.6-2.8
I was under the impression that python strings are immutable as well. I tried compiling this code and it did indeed fail. In my own working solution I had to create a separate string and return that.
I took a more forward approach rather than the reverse route because of this:
The text was updated successfully, but these errors were encountered: