Company: Practo_SDE_Intern_
Difficulty: medium
String Compression Problem Statement You are given a string consisting of lowercase English letters. Your task is to compress the string into a new format where consecutive repeated characters are replaced with the character followed by the count of its repetitions. Note: The original problem statement had a slight ambiguity. Based on the examples, if a character appears in a consecutive sequence of one, it should be followed by the number 1. Input & Output Input Format A string s containing only lowercase English letters. Output Format A string representing 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