Find length of longest string in a list more efficiently