title: negative palindrome number failure
body: <p>i need to determine if a number is palindrome or not
  ex: 121 yes,
  ex: -121 no.
  the program seems to work with palindrome numbers however i am having trouble figuring out the negative numbers, and non palindrome numbers</p>
  <pre><code>class Solution {
  public:
      bool isPalindrome(int x) {
          int reverse = 0;
          int digit;
          int n = x;
          bool t = true;
           while(x &gt; 0){
               digit = x%10;
               reverse = (reverse*10) + digit;
               x = x/10;  
           }
          if (n == reverse) {
           return t;
          } 
          else if(n != reverse) {
              return -1;
          }
      return -1;
           
      }
  };
  </code></pre>