title: Count Numbers That Dont Contain 3
signature: def countNumbersThatDontContain3(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Double , expected: Double): Boolean = {
      (actual - expected).abs < 1e-09
  }
  
  def driver(n: Int, expected: Double): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        85, 
        71.5    
      )}")   
  
  
      println(s"TEST-1...${driver(
        86, 
        73.39999999999999    
      )}")   
  
  
      println(s"TEST-2...${driver(
        3, 
        2.0    
      )}")   
  
  
      println(s"TEST-3...${driver(
        35, 
        26.5    
      )}")   
  
  
      println(s"TEST-4...${driver(
        59, 
        52.1    
      )}")   
  
  
      println(s"TEST-5...${driver(
        38, 
        32.2    
      )}")   
  
  
      println(s"TEST-6...${driver(
        33, 
        22.7    
      )}")   
  
  
      println(s"TEST-7...${driver(
        15, 
        17.5    
      )}")   
  
  
      println(s"TEST-8...${driver(
        75, 
        62.5    
      )}")   
  
  
      println(s"TEST-9...${driver(
        74, 
        60.6    
      )}")   
  
  }
  
source_py: def count_numbers_that_dont_contain_3(n):
      if (n < 3):
          return n
      elif ((n >= 3) and (n < 10)):
          return (n - 1)
      po = 1
      while ((n / po) > 9):
          po = (po * 10)
      msd = (n / po)
      if (msd != 3):
          return (((count_numbers_that_dont_contain_3(msd) * count_numbers_that_dont_contain_3((po - 1))) + count_numbers_that_dont_contain_3(msd)) + count_numbers_that_dont_contain_3((n % po)))
      else:
          return count_numbers_that_dont_contain_3(((msd * po) - 1))
source_cpp: int count_numbers_that_dont_contain_3(int n) {
    if ( n < 3 ) return n;
    if ( n >= 3 && n < 10 ) return n - 1;
    int po = 1;
    while ( n / po > 9 ) po = po * 10;
    int msd = n / po;
    if ( msd != 3 ) return count_numbers_that_dont_contain_3 ( msd ) * count_numbers_that_dont_contain_3 ( po - 1 ) + count_numbers_that_dont_contain_3 ( msd ) + count_numbers_that_dont_contain_3 ( n % po );
    else return count_numbers_that_dont_contain_3 ( msd * po - 1 );
  }