Skip to content
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

Chapter 1, question 3 bug #22

Open
alexsheehan opened this issue Feb 14, 2019 · 0 comments
Open

Chapter 1, question 3 bug #22

alexsheehan opened this issue Feb 14, 2019 · 0 comments

Comments

@alexsheehan
Copy link

If you assign a value to an index greater than the length of the string, the string doesn't increase in size like an array does (I assume this is why in the book it says 'If implementing in Java, please use a character array so that you can perform this operation in place.'). The tests pass because the string is being converted to an array to test it: expect(func(arg.split(''))).to.eql(expected);
I haven't been able to find a way to expand a string's length in place in JavaScript, so I'm not sure it's possible to do in O(1) space (specifically in JS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant