title: Count Distinct Non Negative Pairs X Y Satisfy Inequality Xx Yy N 2
signature: function countDistinctNonNegativePairsXYSatisfyInequalityXxYyN2(n) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(61, 54);
    console.log(`TEST-0...${result}`);
  
    result = driver(45, 41);
    console.log(`TEST-1...${result}`);
  
    result = driver(53, 50);
    console.log(`TEST-2...${result}`);
  
    result = driver(4, 4);
    console.log(`TEST-3...${result}`);
  
    result = driver(82, 73);
    console.log(`TEST-4...${result}`);
  
    result = driver(86, 79);
    console.log(`TEST-5...${result}`);
  
    result = driver(37, 35);
    console.log(`TEST-6...${result}`);
  
    result = driver(48, 43);
    console.log(`TEST-7...${result}`);
  
    result = driver(81, 71);
    console.log(`TEST-8...${result}`);
  
    result = driver(50, 45);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
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;
  }