Solutions for Run-length encoding