just writing my python solution, I know this will not be the best answer, but i think this one is easy to read.
for p in 2,3,5: while num%p == 0 and num >0: num /= p return num == 1:
if someBooleanExpression: return True else: return False
is ridiculous in general, but if it's like half of your whole code... come on... just do
return num == 1
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.