Class Solution
java.lang.Object
g2401_2500.s2443_sum_of_number_and_its_reverse.Solution
2443 - Sum of Number and Its Reverse.<p>Medium</p>
<p>Given a <strong>non-negative</strong> integer <code>num</code>, return <code>true</code> <em>if</em> <code>num</code> <em>can be expressed as the sum of any <strong>non-negative</strong> integer and its reverse, or</em> <code>false</code> <em>otherwise.</em></p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> num = 443</p>
<p><strong>Output:</strong> true</p>
<p><strong>Explanation:</strong> 172 + 271 = 443 so we return true.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> num = 63</p>
<p><strong>Output:</strong> false</p>
<p><strong>Explanation:</strong> 63 cannot be expressed as the sum of a non-negative integer and its reverse so we return false.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> num = 181</p>
<p><strong>Output:</strong> true</p>
<p><strong>Explanation:</strong> 140 + 041 = 181 so we return true. Note that when a number is reversed, there may be leading zeros.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>0 <= num <= 10<sup>5</sup></code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
sumOfNumberAndReverse
public boolean sumOfNumberAndReverse(int num)
-