Join Regular Classroom : Visit ClassroomTech

Coding Questions | Frequency Count | Codewindow.in

Eve has created a robot that will take instructions and work accordingly. Due to budget problem, she has set the memory low. To overcome that, she has to encode the instruction. Given the instruction, count the consecutive characters and each character will be followed by its frequency.

For example, if the instruction is “aaaabb”, the encoded instruction is “a4b2”.
Note: If the frequency is one, the count need not be printed.

Example:
Input:
sggvvvgss

output:
sg2v3gs2

Solution:

Coming....
You Missed
Also Checkout