#C1622. Run-Length Encoding
Run-Length Encoding
Run-Length Encoding
Given a string s consisting of lowercase letters, your task is to encode the string using run-length encoding. In this method, sequences of consecutive identical characters are replaced by the character followed by the number of times it occurs consecutively. Formally, if the string can be divided into groups \(g_i\) where each group consists of repeated characters \(c_i\) with count \(n_i\), then the encoded string is given by:
\( encoded(s) = c_1 n_1 c_2 n_2 \ldots c_k n_k \)
For example, the string "aaabbccca" should be encoded as "a3b2c3a1".
inputFormat
The input consists of a single line containing a non-empty string composed only of lowercase letters.
outputFormat
Output the run-length encoded form of the input string on a single line. For an empty input, the output should be an empty string.
## sampleaaabbccca
a3b2c3a1