title: Circle Lattice Points
signature: class Solution {
  
      public Integer circleLatticePoints(Integer r) {
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;
  }
question_info.extension: java
question_info.entry_fn_name: circleLatticePoints
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 12, "inputs": {"r": 34}}, {"idx": 1, "outputs": 4, "inputs": {"r": 56}}, {"idx": 2, "outputs": 12, "inputs": {"r": 90}}, {"idx": 3, "outputs": 4, "inputs": {"r": 47}}, {"idx": 4, "outputs": 4, "inputs": {"r": 36}}, {"idx": 5, "outputs": 4, "inputs": {"r": 63}}, {"idx": 6, "outputs": 4, "inputs": {"r": 21}}, {"idx": 7, "outputs": 4, "inputs": {"r": 76}}, {"idx": 8, "outputs": 4, "inputs": {"r": 18}}, {"idx": 9, "outputs": 20, "inputs": {"r": 75}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer r, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(r,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(34, 12);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(56, 4);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(90, 12);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(47, 4);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(36, 4);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(63, 4);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(21, 4);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(76, 4);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(18, 4);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(75, 20);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer r, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(r),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__