title: Square Root Of An Integer
signature: pub fn square_root_of_an_integer(x: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(x: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(x), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        89, 
        9
      ));
      
      println!("TEST-1...{}", driver(
        11, 
        3
      ));
      
      println!("TEST-2...{}", driver(
        14, 
        3
      ));
      
      println!("TEST-3...{}", driver(
        92, 
        9
      ));
      
      println!("TEST-4...{}", driver(
        76, 
        8
      ));
      
      println!("TEST-5...{}", driver(
        63, 
        7
      ));
      
      println!("TEST-6...{}", driver(
        51, 
        7
      ));
      
      println!("TEST-7...{}", driver(
        16, 
        4
      ));
      
      println!("TEST-8...{}", driver(
        83, 
        9
      ));
      
      println!("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;
  }