Leetcode - Coin Change 2
Leetcode - Power of Three

Leetcode - Power of Two

violet posted @ Jun 09, 2020 12:36:12 AM in 算法 with tags Algorithm Golang math , 288 阅读

https://leetcode.com/problems/power-of-two/

Given an integer, write a function to determine if it is a power of two.

Example 1:

Input: 1
Output: true 
Explanation: 20 = 1

Example 2:

Input: 16
Output: true
Explanation: 24 = 16

 

func isPowerOfTwo(n int) bool {
    return n > 0 && 1073741824 % n == 0
}
+2 Admit Card 2024 说:
Feb 14, 2023 06:34:56 PM

Candidates to verify that the data they provided is accurate. In order to prevent students from misplacing their exam results after finishing them, hall passes are necessary. The scheduled date for the exams will soon be announced by the Board of Education. +2 Admit Card 2024 On the board’s official website, Inter Admit Card 2024 for the second years are now accessible. Where candidates can download it for later use The Inter hall ticket 2024 release date exam period.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter