Company: Practo_SDE_Intern_
Difficulty: medium
String Compression Problem Statement You are given a string made up of lowercase English letters. Your task is to compress it into a new format where every run of consecutive repeated characters is replaced by that character followed by how many times it repeats. Note: The original version of this statement left some room for ambiguity. Going by the examples, if a character occurs by itself (a run of length one), it should still be followed by the number 1. Input & Output Input Format A string s containing only lowercase English letters. Output Format A string giving the compressed version of the input. Examples Example 1 Input: aaaabbbcca Output: a4b3c2a1 Example 2 Input: abcccdd Output: a1b1c3d2 Example 3 Input: bbbb Output: b4 Constraints 1 <= len(s) <= 100