title: Eulers Criterion Check If Square Root Under Modulo P Exists
signature: function eulers_criterion_check_if_square_root_under_modulo_p_exists(n, p)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, p, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n, p), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(71, 78, false);
      @printf("TEST-0...%s\n",result);
      
      result = driver(85, 75, false);
      @printf("TEST-1...%s\n",result);
      
      result = driver(4, 35, true);
      @printf("TEST-2...%s\n",result);
      
      result = driver(20, 99, false);
      @printf("TEST-3...%s\n",result);
      
      result = driver(71, 29, true);
      @printf("TEST-4...%s\n",result);
      
      result = driver(72, 88, false);
      @printf("TEST-5...%s\n",result);
      
      result = driver(36, 54, true);
      @printf("TEST-6...%s\n",result);
      
      result = driver(95, 52, false);
      @printf("TEST-7...%s\n",result);
      
      result = driver(83, 33, false);
      @printf("TEST-8...%s\n",result);
      
      result = driver(72, 13, false);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def eulers_criterion_check_if_square_root_under_modulo_p_exists(n, p):
      n = (n % p)
      for x in range(2, p, 1):
          if (((x * x) % p) == n):
              return True
      return False
source_cpp: bool eulers_criterion_check_if_square_root_under_modulo_p_exists(int n, int p) {
    n = n % p;
    for ( int x = 2;
    x < p;
    x ++ ) if ( ( x * x ) % p == n ) return true;
    return false;
  }