Is there a way to reduce a duplicated characters to specific number, for example if we have this string.
"I liiiiked it, thaaaaaaank you"
Expected output: "I liiiiked it thaaaank you"
so if the duplicated character over 4, for example, it should be reduced to only four characters and if it less than or equal 4 then the word should stays the same.