title: Eulers Criterion Check If Square Root Under Modulo P Exists
signature: eulersCriterionCheckIfSquareRootUnderModuloPExists(n, p) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, p, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n, p), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          71, 78, 
          false)
      }");
  
      print("TEST-1...${driver(
          85, 75, 
          false)
      }");
  
      print("TEST-2...${driver(
          4, 35, 
          true)
      }");
  
      print("TEST-3...${driver(
          20, 99, 
          false)
      }");
  
      print("TEST-4...${driver(
          71, 29, 
          true)
      }");
  
      print("TEST-5...${driver(
          72, 88, 
          false)
      }");
  
      print("TEST-6...${driver(
          36, 54, 
          true)
      }");
  
      print("TEST-7...${driver(
          95, 52, 
          false)
      }");
  
      print("TEST-8...${driver(
          83, 33, 
          false)
      }");
  
      print("TEST-9...${driver(
          72, 13, 
          false)
      }");
  
      return 0;
  }
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;
  }