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
相關文章
相關標籤/搜索