263. 丑数
把因数一个个除掉。
class Solution {
public boolean isUgly(int n) {
if(n==0) return false;
int[] factor = {2,3,5};
for(int f : factor){
while(n%f==0)
n/=f;
}
return n==1;
}
}
标签:10,return,丑数,int,263,2021,factor
来源: https://blog.csdn.net/weixin_44495738/article/details/115586716