File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -------------------------------------------------------
2
+ # Power of Four - https://leetcode.com/explore/challenge/card/august-leetcoding-challenge/549/week-1-august-1st-august-7th/3412/
3
+ # -------------------------------------------------------
4
+ # Author: Arshad Mehmood
5
+ # Github: https://github.com/arshad115
6
+ # Blog: https://arshadmehmood.com
7
+ # LinkedIn: https://www.linkedin.com/in/arshadmehmood115
8
+ # Date : 2020-08-4
9
+ # Project: leetcode-august-2020
10
+ # -------------------------------------------------------
11
+ from math import log
12
+
13
+ class Solution :
14
+ def isPowerOfFour (self , num : int ) -> bool :
15
+ return num >= 1 and log (num , 4 ).is_integer ()
16
+
17
+ solution = Solution ()
18
+ result = solution .isPowerOfFour (4 )
19
+ print (result )
20
+
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ My leetcode profile can be viewed [here](https://leetcode.com/arshad115/)
9
9
| 1 | [ Detect Capital] ( ./codes/1-detect-capital.py ) |
10
10
| 2 | [ Design Hashset] ( ./codes/2-design-hashset.py ) |
11
11
| 3 | [ Valid Palindrome] ( ./codes/3-valid-palindrome.py ) |
12
+ | 4 | [ Power of Four] ( ./codes/4-valid-palindrome.py ) |
You can’t perform that action at this time.
0 commit comments