mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 16:36:41 +08:00
11 lines
140 B
Go
11 lines
140 B
Go
package leetcode
|
|
|
|
func isUgly(num int) bool {
|
|
for i := 2; i < 6 && num > 0; i++ {
|
|
for num%i == 0 {
|
|
num /= i
|
|
}
|
|
}
|
|
return num == 1
|
|
}
|