326. Power of Three

Given an integer, write a function to determine if it is a power of three.web Follow up: Could you do it without using any loop / recursion?svg s思路: 1. 看是否3的指数,即判断n==3^i。直接的方法就是每次和3求余,若是为0,就除以3,看是否等于1
相关文章
相关标签/搜索