LeetCode Solutions/November 2022 LeetCoding Challenge/Ugly Number.java
class Solution {
    public boolean isUgly(int n) {
        while (n > 0){
            if (n == 1){
                return true;
            }
            else if (n % 2 == 0){
                n /= 2;
            }
            else if (n % 3 == 0){
                n /= 3;
            }
            else if (n % 5 == 0){
                n /= 5;
            }
            else{
                return false;
            }
        }
        return false;
    }
}