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

[FEATURE] Run-length encoding #66

Open
Turtel216 opened this issue Nov 22, 2024 · 0 comments · May be fixed by #65
Open

[FEATURE] Run-length encoding #66

Turtel216 opened this issue Nov 22, 2024 · 0 comments · May be fixed by #65
Assignees
Labels
enhancement New feature or request

Comments

@Turtel216
Copy link

Turtel216 commented Nov 22, 2024

Feature Description

Please provide a brief description of the feature you would like to see implemented.

Add a Run-length encoding and decoding function to the strings module.


Use Case

Describe the use case for this feature. Why would it be beneficial to have this functionality?

Useful for lossless compression of strings with repeating characters, i.e. aaabbb -> 3a3b


Pseudo Code

RunLengthEncode

func main() {
	encoded := strings.RunLengthEncode("aaabbbccc")
	fmt.Println(encoded) // Output: 3a3b3c
}

RunLengthDecode

func main() {
	decoded := strings.RunLengthDecode("3a3b3c")
	fmt.Println(decoded) // Output: aaabbbccc
}
@Turtel216 Turtel216 changed the title [FEATURE] Title [FEATURE] Run-length encoding Nov 22, 2024
@Turtel216 Turtel216 linked a pull request Nov 22, 2024 that will close this issue
3 tasks
@kashifkhan0771 kashifkhan0771 added the enhancement New feature or request label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants