title: Circle Lattice Points
signature: pub fn circle_lattice_points(r: 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(r: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(r), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        34, 
        12
      ));
      
      println!("TEST-1...{}", driver(
        56, 
        4
      ));
      
      println!("TEST-2...{}", driver(
        90, 
        12
      ));
      
      println!("TEST-3...{}", driver(
        47, 
        4
      ));
      
      println!("TEST-4...{}", driver(
        36, 
        4
      ));
      
      println!("TEST-5...{}", driver(
        63, 
        4
      ));
      
      println!("TEST-6...{}", driver(
        21, 
        4
      ));
      
      println!("TEST-7...{}", driver(
        76, 
        4
      ));
      
      println!("TEST-8...{}", driver(
        18, 
        4
      ));
      
      println!("TEST-9...{}", driver(
        75, 
        20
      ));
      
  }
source_py: def circle_lattice_points(r):
      if (r <= 0):
          return 0
      result = 4
      for x in range(1, r):
          ySquare = ((r * r) - (x * x))
          y = int(math.sqrt(ySquare))
          if ((y * y) == ySquare):
              result += 4
      return result
source_cpp: int circle_lattice_points(int r) {
    if ( r <= 0 ) return 0;
    int result = 4;
    for ( int x = 1;
    x < r;
    x ++ ) {
      int ySquare = r * r - x * x;
      int y = sqrt ( ySquare );
      if ( y * y == ySquare ) result += 4;
    }
    return result;
  }