title: Algorithm to find positive and negative integer square roots (without given boundaries)
body: <p>I've been practicing a lot of algorithms recently for an interview. I was wondering if there was another way to solve this problem. I wrote it in a way where I only increment it positively, because I know from basic math that two negatives multiplied by each other would result to a positive number, so I would just have to make the integer that would satisfy the condition to negative. </p>
  
  <p>Is there a way to write this <strong>elegantly</strong> where you didn't have the knowledge of multiplying two negative numbers result to a positive?</p>
  
  <pre><code>&lt;?php
  
  # Z = {integers}
  # B = {x:x, x is an element of Z,  x^2 + 1 = 10}
  
  $numNotFound = true;
  $x = 0;
  $b = [];
  
  while ($numNotFound) {
      if ($x*$x + 1 == 10) {
          array_push($b, $x, $x*-1);
          $numNotFound = false;
      }
      $x++;
  }
  
  echo json_encode($b); #[3, -3]
  </code></pre>