Number #36 sped up by using array instead of string.