Power of Two Leetcode Solution in Java (231)
Source Code and Doubts - https://www.instagram.com/economic__coder/
In this video we are going to discuss the leetcode problem number 231 (Power of Two) through java.
We are also discuss how to solve the Power of Two using java programming language.
Power of Two LOGIC - They will give you a number . You need to return true if that number is power of two.
For This problem, you can easily solve using some mathematical operations.
Given an integer n, return true if it is a power of two. Otherwise, return false.
An integer n is a power of two, if there exists an integer x such that n == 2x.
Example 1:
Input: n = 1
Output: true
Explanation: 20 = 1
Example 2:
Input: n = 16
Output: true
Explanation: 24 = 16
Example 3:
Input: n = 3
Output: false
Thanks for viewing
#leetcode
#poweroftwo
#leetcodesolution
Download
0 formats
No download links available.
POWER OF TWO (LEETCODE 231) SOLUTION IN JAVA | POWER OF TWO | LEETCODE | PROBLEM SOLVING | NatokHD