RLE encoding solution
Tartaglia's triangle solution