Leetcode#231. Power of Two(2次冪)

題目 Given an integer, write a function to determine if it is a power of two. python 題意 給你一個整數,判讀是不是2的冪次方。web 題解 解法一:簡單解法 1.特殊考慮1和0 2.一個數除2無非就有兩個結果: (1)能除盡,除不盡 (2)能除盡: 商爲1(最後一步,2/2=1 ) 商不爲1svg Python語言
相關文章
相關標籤/搜索