solve counting-tiles