mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-04 16:12:47 +08:00
13 lines
161 B
Go
13 lines
161 B
Go
package leetcode
|
|
|
|
func isUgly(num int) bool {
|
|
if num > 0 {
|
|
for _, i := range []int{2, 3, 5} {
|
|
for num%i == 0 {
|
|
num /= i
|
|
}
|
|
}
|
|
}
|
|
return num == 1
|
|
}
|