<p>Given an integer <code>n</code>, return <em><code>true</code> if it is a power of three. Otherwise, return <code>false</code></em>.</p>

<p>An integer <code>n</code> is a power of three, if there exists an integer <code>x</code> such that <code>n == 3<sup>x</sup></code>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> n = 27
<strong>Output:</strong> true
<strong>Explanation:</strong> 27 = 3<sup>3</sup>
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> n = 0
<strong>Output:</strong> false
<strong>Explanation:</strong> There is no x where 3<sup>x</sup> = 0.
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> n = -1
<strong>Output:</strong> false
<strong>Explanation:</strong> There is no x where 3<sup>x</sup> = (-1).
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>-2<sup>31</sup> &lt;= n &lt;= 2<sup>31</sup> - 1</code></li>
</ul>

<p>&nbsp;</p>
<strong>Follow up:</strong> Could you solve it without loops/recursion?
const unordered_set<string> st {
            "1", "3", "9", "27", "81", "243", "729", "2187", "6561", "19683", "59049", "177147", "531441", "1594323", "4782969", "14348907", "43046721", "129140163", "387420489", "1162261467"
        };
class Solution {
public:
    bool isPowerOfThree(int n) {
        return false;
    }
};

auto init = ([]() -> char {
    ios_base::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);

    ofstream out("user.out");
    string s;
    auto stEnd = st.end();
    while(getline(cin, s)) {
        out << (stEnd != st.find(s) ? "true" : "false") << '\n';
    }
    out << "fuck\n";
    out.flush();
    exit(0);
    return 1;
})();
7500