Is Power of Three

Determine if a given integer is a power of three. A number is a power of three if it can be expressed as 3 raised to some integer exponent. Powers of three include 1, 3, 9, 27, and so on.

Examples
Input: 27
Output: true
Hints

Is Power of Three

Determine if a given integer is a power of three. A number is a power of three if it can be expressed as 3 raised to some integer exponent. Powers of three include 1, 3, 9, 27, and so on.