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 摘要。