Skip to content

Commit 0ab805f

Browse files
committed
Time: N/A (0%), Space: N/A (0%) - LeetHub
1 parent 1e66921 commit 0ab805f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function isPowerOfTwo(n: number): boolean {
2+
if (n === 1) return true;
3+
return n % 2 === 0 ? isPowerOfTwo(n/2) : false;
4+
};

0 commit comments

Comments
 (0)