From b846d2732c46f91c478620164c186865cbf99971 Mon Sep 17 00:00:00 2001 From: Mohd Musaiyab <106825955+MohdMusaiyab@users.noreply.github.com> Date: Fri, 2 Jun 2023 22:36:43 +0530 Subject: [PATCH] Create Power of 2 --- Power of 2 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Power of 2 diff --git a/Power of 2 b/Power of 2 new file mode 100644 index 0000000..d6e2ac9 --- /dev/null +++ b/Power of 2 @@ -0,0 +1,8 @@ +class Solution: + def isPowerofTwo(self,n): + x=1 + while x<=n: + if x==n: + return True + x=x*2 + return False