In a factory, a printer prints labels for boxes. For one kind of box, the printer has to use colors which, for the sake of simplicity, are named wi...
For further actions, you may consider blocking this person and/or reporting abuse
JS
Python solution 🐍
Haskell
Test
Kotlin
Output
printer_error("aaabbbbhaijjjm")->0/14printer_error("aaaxbbbbyyhwawiwjjjwwm")->8/22printer_error("aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbmmmmmmmmmmmmmmmmmmmxyz")->3/56printer_error("aaabbbbbbccccccddddddeee")->0/24printer_error("verylargepiggoesoink")->9/20JS - Functional, no regex.
JS w/ regexp
Python w/o regexp
Here is the simple solution with PHP and
ASCIIcode function:nodejs
And a silly one:
Python
JavaScript
Javascript
Javascript
Ruby
how to count with javascript regex