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 ) {    
相關文章
相關標籤/搜索