I have r = to how many times can letter be repeated in a row and s = to string to check.
For example if s = "aaabbbccc777" and r = 2. result = "aabbcc77".
I need it to be dynamic and as easy and clean as possible.
Thanks for the help in advance.
let s = "bbbaaaccc777cdggg";
let r = 2;
const verification = (s, r) => {
}
verification(s, r);