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

Not handled second part of the question #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patlolla-sai-charan-reddy
Copy link
Contributor

If the "compressed" string would not become smaller than the original string, your method should return the original string

` If the "compressed" string would not become smaller than the original string, your method should return the original string`
console.log('aaaaaa', stringCompression('aabcdef')); // aabcdef
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a2bcdef for this one? I'm thinking that the only stuff you should not compress is when the rep is 1, but for anything more than that, will be good to compress -- for simplicity sake. Though I understand |a2| == |aa|

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the late response.

per my understanding of the question, if the length of the output is greater then or equal to the length of input we should simply return the input.

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

Successfully merging this pull request may close these issues.

None yet

2 participants