LeetCode 231: Power Of Two [C++, Python]

preview_player
Показать описание
Explained solution of LeetCode 231: Power Of Two: "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 == 2^x."

We are going to implement fastest solution using bitwise operators with time and space complexity O(1) in C++ and Python, C.

Code from today's lesson:

LeetCode 231: Power Of Two:

Lesson Content:
0:00 Task Description
1:04 Solution
5:07 C++ Code
6:03 Python Code
Рекомендации по теме