title: Count Distinct Non Negative Pairs X Y Satisfy Inequality Xx Yy N 2
signature: class Solution {
  
      public Integer countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2(Integer n) {
source_py: def count_distinct_non_negative_pairs_x_y_satisfy_inequality_xx_yy_n_2(n):
      res = 0
      x = 0
      while ((x * x) < n):
          y = 0
          while (((x * x) + (y * y)) < n):
              res = (res + 1)
              y = (y + 1)
          x = (x + 1)
      return res
source_cpp: int count_distinct_non_negative_pairs_x_y_satisfy_inequality_xx_yy_n_2(int n) {
    int res = 0;
    for ( int x = 0;
    x * x < n;
    x ++ ) for ( int y = 0;
    x * x + y * y < n;
    y ++ ) res ++;
    return res;
  }
question_info.extension: java
question_info.entry_fn_name: countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 54, "inputs": {"n": 61}}, {"idx": 1, "outputs": 41, "inputs": {"n": 45}}, {"idx": 2, "outputs": 50, "inputs": {"n": 53}}, {"idx": 3, "outputs": 4, "inputs": {"n": 4}}, {"idx": 4, "outputs": 73, "inputs": {"n": 82}}, {"idx": 5, "outputs": 79, "inputs": {"n": 86}}, {"idx": 6, "outputs": 35, "inputs": {"n": 37}}, {"idx": 7, "outputs": 43, "inputs": {"n": 48}}, {"idx": 8, "outputs": 71, "inputs": {"n": 81}}, {"idx": 9, "outputs": 45, "inputs": {"n": 50}}]
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 n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(61, 54);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(45, 41);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(53, 50);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(4, 4);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(82, 73);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(86, 79);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(37, 35);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(48, 43);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(81, 71);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(50, 45);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),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__