202. Happy Number

用HashSet存储已经出现过的数字,若重复出现肯定就不行了。 public boolean isHappy(int n) {     Set<Integer> inLoop = new HashSet<Integer>();     int squareSum,remain; while (inLoop.add(n)) { squareSum = 0 ; while (n > 0 ) {    
相关文章
相关标签/搜索