思路:遍历一次字符串,当遍历到字符为数字时,计算数值(number = number*10 + (word.charAt(i)-'0');),知道遍历到字符不为数字,将数值加入hash集合。遍历到字符不为数字时,继续遍历。