Back to Browse

Explaining Leetcode #342 Power of Four (Easy)

82 views
Premiered Mar 1, 2021
8:59

In this video I explain the algorithm behind solving Leetcode problem #342 Power of Four. Here I find if a number is a power of two as explained in #231 Power of Two (https://youtu.be/PE-kiUrAiAQ), and then I count if it has an even number of zeros to the right of the only set bit. I am coding in Java since its syntax is easy to understand by all programmers. The algorithms can be applied easily in other languages and most functions that I use have a counterpart in your language of choice. 0:00 Explaining the problem concept 2:39 First coding attempt 6:17 Explaining the problem in the first attempt 7:02 Fixing the problem and reaching an optimal solution Related Topics: Math, Bit Manipulation

Download

1 formats

Video Formats

360pmp413.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Explaining Leetcode #342 Power of Four (Easy) | NatokHD