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

1.6 String Comparison Error #91

Open
mrzakch opened this issue Oct 29, 2021 · 0 comments
Open

1.6 String Comparison Error #91

mrzakch opened this issue Oct 29, 2021 · 0 comments

Comments

@mrzakch
Copy link

mrzakch commented Oct 29, 2021

The provided solution assumes that any computed compressed string "compressed" will be shorter than the provided string "string" only if the maximum count for every input is 1. This is incorrect. Take the counterexample string "abcdd" (len:5). When compressed by the given solution, the proposed compressed string is given as "a1b1c1d2" (len:8). A better solution would be to simply compare the lengths of the given string before returning.

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