package com.fishercoder.solutions;

/**Write a program to check whether a given number is an ugly number.

 Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7.

 Note that 1 is typically treated as an ugly number.*/

public class _263 {

    public boolean isUgly(int num) {
        if (num == 0) {
            return false;
        }
        int[] divisors = new int[]{5, 3, 2};
        for (int divisor : divisors) {
            while (num % divisor == 0) {
                num /= divisor;
            }
        }
        return num == 1;
    }

}

@@ -33,324 +33,69 @@
 s;%0A%0A
-/**Write a program to check whether a given number is an ugly number.%0A%0A Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly since it includes another prime factor 7.%0A%0A Note that 1 is typically treated as an ugly number.*/%0A%0Apublic class _263 %7B%0A%0A
+public class _263 %7B%0A%0A    public static class Solution1 %7B%0A    
     
@@ -135,16 +135,20 @@
         
+    
 if (num 
@@ -163,24 +163,28 @@
             
+   
+ 
 return false
@@ -185,34 +185,42 @@
  false;%0A        
-%7D%0A
+    %7D%0A    
         int%5B%5D di
@@ -256,16 +256,20 @@
         
+  
+  
 for (int
@@ -287,24 +287,28 @@
 divisors) %7B%0A
+    
             
@@ -352,16 +352,20 @@
         
+    
 num /= d
@@ -384,26 +384,33 @@
         
+ 
-%7D%0A
+   %7D%0A   
         
 %7D%0A      
@@ -393,34 +393,39 @@
    %7D%0A           
+ 
 %7D%0A
+    
         return n
@@ -433,16 +433,26 @@
 m == 1;%0A
+        %7D%0A
     %7D%0A%0A%7D

refactor 263