Submit | All submissions | Best solutions | Back to list |
POFT - Power of Two |
Given an integer, write a function to determine if it is a power of two.
Input
First line contains an integer n indicating the number of test cases to follow. Each test case will be an integer.
Output
The boolean value of whether a number is a power of two.
Example
Input: 4
1
9
8
10 Output: true
false
true
false
Added by: | BYU Admin |
Date: | 2015-12-15 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 MAWK BC NCSHARP COFFEE DART FORTH GOSU JS-MONKEY JULIA KTLN OCT PROLOG PYPY3 R RACKET SQLITE SWIFT UNLAMBDA |
Resource: | LeetCode |