title: Square Root Of An Integer
signature: def squareRootOfAnInteger(x: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(x: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(x),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        89, 
        9    
      )}")   
  
  
      println(s"TEST-1...${driver(
        11, 
        3    
      )}")   
  
  
      println(s"TEST-2...${driver(
        14, 
        3    
      )}")   
  
  
      println(s"TEST-3...${driver(
        92, 
        9    
      )}")   
  
  
      println(s"TEST-4...${driver(
        76, 
        8    
      )}")   
  
  
      println(s"TEST-5...${driver(
        63, 
        7    
      )}")   
  
  
      println(s"TEST-6...${driver(
        51, 
        7    
      )}")   
  
  
      println(s"TEST-7...${driver(
        16, 
        4    
      )}")   
  
  
      println(s"TEST-8...${driver(
        83, 
        9    
      )}")   
  
  
      println(s"TEST-9...${driver(
        66, 
        8    
      )}")   
  
  }
  
source_py: def square_root_of_an_integer(x):
      if ((x == 0) or (x == 1)):
          return x
      i = 1
      result = 1
      while (result <= x):
          i += 1
          result = (i * i)
      return (i - 1)
source_cpp: int square_root_of_an_integer(int x) {
    if ( x == 0 || x == 1 ) return x;
    int i = 1, result = 1;
    while ( result <= x ) {
      i ++;
      result = i * i;
    }
    return i - 1;
  }