Pinterest Interview Question

a more complex look and say problem