0
Hello! I have a problem. I don't write code fort this task. Can you help me?
Learning that DNA is not a random string, the students of the informatics group who have just entered the Institute of Bioinformatics suggested using a compression algorithm that compresses duplicate characters in a line. Coding is carried out as follows: S = 'aaaabbсaa' is converted to 'a4b2c1a2', that is, groups of identical characters of the original string are replaced by this symbol and the number of its repetitions at that li
4 Respostas
+ 5
Here's one way- https://code.sololearn.com/c89Ov8dakgsY/?ref=app
+ 2
https://code.sololearn.com/WYuLWKzwa2jv/?ref=app
Here I made using JS
+ 1
It's called run-length encoding :)
0
Is it worth the effort? In your example the new string is hardly shorter?