Power of Four
Given an integer , return if it is a power of four. Otherwise, return .
An integer is a power of four, if there exists an integer such that .
Given an integer , return if it is a power of four. Otherwise, return .
An integer is a power of four, if there exists an integer such that .
Given an integer , return an array of length such that for each (), is the number of ‘s in the binary representation of .
Example 1:
Given an integer , return if it is a power of three. Otherwise, return .
An integer is a power of three, if there exists an integer such that .
303.Range Sum Query - Immutable
Given an integer array , handle multiple queries of the following type:
You are playing the following Nim Game with your friend:
Given a and a string , find if follows the same pattern.
Here follow means a full match, such that there is a bijection between a letter in and a non-empty word in .
Given an integer array , move all ‘s to the end of it while maintaining the relative order of the non-zero elements.
Note that you must do this in-place without making a copy of the array.
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
Suppose you have versions and you want to find out the first bad one, which causes all the following ones to be bad.
Given an array containing distinct numbers in the range , return the only number in the range that is missing from the array.
Example 1:
An ugly number is a positive integer whose prime factors are limited to , , and .
Given an integer , return if is an ugly number.