title: Eulers Criterion Check If Square Root Under Modulo P Exists
signature: fun eulersCriterionCheckIfSquareRootUnderModuloPExists(n: Int, p: Int): Boolean {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, p: Int, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n, p), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(71, 78, false)
      println("TEST-0...${result}")
      
      result = driver(85, 75, false)
      println("TEST-1...${result}")
      
      result = driver(4, 35, true)
      println("TEST-2...${result}")
      
      result = driver(20, 99, false)
      println("TEST-3...${result}")
      
      result = driver(71, 29, true)
      println("TEST-4...${result}")
      
      result = driver(72, 88, false)
      println("TEST-5...${result}")
      
      result = driver(36, 54, true)
      println("TEST-6...${result}")
      
      result = driver(95, 52, false)
      println("TEST-7...${result}")
      
      result = driver(83, 33, false)
      println("TEST-8...${result}")
      
      result = driver(72, 13, false)
      println("TEST-9...${result}")
      
          
  }
  
  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;
  }