akshitagit / akshitagit/Python

Strings Compression

未关闭
#47 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
algorithms datastructures DSA hacktoberfest hacktoberfest2020 hactoberfest Strings
主要语言
Python
星标
124
派生
109
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。