title: Sequences Given Length Every Element Equal Twice Previous
signature: def sequencesGivenLengthEveryElementEqualTwicePrevious(m: Int, n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(m: Int, n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(m, n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        38, 34, 
        0    
      )}")   
  
  
      println(s"TEST-1...${driver(
        39, 29, 
        0    
      )}")   
  
  
      println(s"TEST-2...${driver(
        24, 99, 
        0    
      )}")   
  
  
      println(s"TEST-3...${driver(
        90, 23, 
        0    
      )}")   
  
  
      println(s"TEST-4...${driver(
        44, 2, 
        484    
      )}")   
  
  
      println(s"TEST-5...${driver(
        49, 70, 
        0    
      )}")   
  
  
      println(s"TEST-6...${driver(
        58, 84, 
        0    
      )}")   
  
  
      println(s"TEST-7...${driver(
        97, 34, 
        0    
      )}")   
  
  
      println(s"TEST-8...${driver(
        99, 72, 
        0    
      )}")   
  
  
      println(s"TEST-9...${driver(
        19, 67, 
        0    
      )}")   
  
  }
  
source_py: def sequences_given_length_every_element_equal_twice_previous(m, n):
      if (m < n):
          return 0
      if (n == 0):
          return 1
      res = (sequences_given_length_every_element_equal_twice_previous((m - 1), n) + sequences_given_length_every_element_equal_twice_previous((m // 2), (n - 1)))
      return res
source_cpp: int sequences_given_length_every_element_equal_twice_previous(int m, int n) {
    if ( m < n ) return 0;
    if ( n == 0 ) return 1;
    return sequences_given_length_every_element_equal_twice_previous ( m - 1, n ) + sequences_given_length_every_element_equal_twice_previous ( m / 2, n - 1 );
  }