Skip to content

sichkar-valentyn/String_Encoding_with_Itertools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

String Encoding with Itertools

Encoding string by grouping repeated letters with itertool library.

Reference to:

[1] Valentyn N Sichkar. Encoding string by grouping repeated letters with itertool library // GitHub platform [Electronic resource]. URL: https://github.com/sichkar-valentyn/String_Encoding_with_Itertools (date of access: XX.XX.XXXX)

Description

Using itertools library to group repeated letters in the string and encode them with the help of function that returns a generator by using key word yield. This task is so called also as basic compressing task.

Algorithm:

  • Finding all repeated letters and calculating them.
  • Returning encoded string with number + letter.
  • No number for letters that are met only once.

Example:

  • input string: aaaBBBBBaCCCCcFfff
  • Encoded string: 3a5Ba4CcF3f

MIT License

Copyright (c) 2018 Valentyn N Sichkar

github.com/sichkar-valentyn

Reference to:

[1] Valentyn N Sichkar. Encoding string by grouping repeated letters with itertool library // GitHub platform [Electronic resource]. URL: https://github.com/sichkar-valentyn/String_Encoding_with_Itertools (date of access: XX.XX.XXXX)

About

Encoding string by grouping repeated letters with itertool library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages