title: Rotate a number 180 degrees and get the same number
body: <p>I thought the problem of rotating a number 180 degrees clockwise ( or ccw) and getting the same number. For all digits, except 3, 4 and 7, the rotated one is a valid digit. (rotate 3 and you get ε). I'm new in C# but I managed to solve it.</p>
  
  <pre><code> public static bool MyMethod(int originalInt)
          {
              bool is180 = false;
  
              if (Array.IndexOf(originalInt.ToString().ToArray(), '3') &gt; -1 || Array.IndexOf(originalInt.ToString().ToArray(), '4') &gt; -1 || Array.IndexOf(originalInt.ToString().ToArray(), '7') &gt; -1)
              {
                  return false;
              }
              else
              {
                  List&lt;int&gt; tempList = new List&lt;int&gt;();
                  int tempInt = originalInt;
                  do
                  {
                      int lastDigit = tempInt % 10;
                      if (lastDigit == 9)
                      {
                          lastDigit = 6;
                      }
                      else if (lastDigit == 6)
                      {
                          lastDigit = 9;
                      }
                      tempInt = tempInt / 10;
                      tempList.Add(lastDigit);
  
                  }
                  while (tempInt &gt; 0);
  
                  tempList.Reverse();
  
                  int tempInt2 = originalInt;
                  int lastDigit2 = 0;
                  foreach (int item in tempList)
                  {
                      lastDigit2 = tempInt2 % 10;
                      if (item == lastDigit2)
                      {
                          is180 = true;
                          tempInt2 = tempInt2 / 10;
                      }
                      else 
                      {
                          return false;
                      }
                  }
              }
              return is180;
          }
  </code></pre>
  
  <p>Can you find a way of solving this simpler? Thank you.</p>