akshitagit / akshitagit/Python

Strings Compression

Aberta
#47 6 comentários 0 reações 0 responsáveis Ver no GitHub
algorithms datastructures DSA hacktoberfest hacktoberfest2020 hactoberfest Strings
Linguagem predominante
Python
Estrelas
124
Forks
109
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Take as input S, a string. Write a function that does basic string compression. Print the value returned. E.g. for input “aaabbccds” print out a3b2c2d1s1.
Input Format

A single String S
Constraints

1 < = length of String < = 1000
Output Format

The compressed String.
Sample Input

aaabbccds

Sample Output

a3b2c2d1s1

Explanation

In the given sample test case 'a' is repeated 3 times consecutively, 'b' is repeated twice, 'c' is repeated twice and 'd and 's' occurred only once.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.