title: Sequences Given Length Every Element Equal Twice Previous
signature: fun sequencesGivenLengthEveryElementEqualTwicePrevious(m: Int, n: Int): Int {
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 );
  }
question_info.test_list: [{"idx": 0, "outputs": 0, "inputs": {"m": 38, "n": 34}}, {"idx": 1, "outputs": 0, "inputs": {"m": 39, "n": 29}}, {"idx": 2, "outputs": 0, "inputs": {"m": 24, "n": 99}}, {"idx": 3, "outputs": 0, "inputs": {"m": 90, "n": 23}}, {"idx": 4, "outputs": 484, "inputs": {"m": 44, "n": 2}}, {"idx": 5, "outputs": 0, "inputs": {"m": 49, "n": 70}}, {"idx": 6, "outputs": 0, "inputs": {"m": 58, "n": 84}}, {"idx": 7, "outputs": 0, "inputs": {"m": 97, "n": 34}}, {"idx": 8, "outputs": 0, "inputs": {"m": 99, "n": 72}}, {"idx": 9, "outputs": 0, "inputs": {"m": 19, "n": 67}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(m: Int, n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(m, n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(38, 34, 0)
      println("TEST-0...${result}")
      
      result = driver(39, 29, 0)
      println("TEST-1...${result}")
      
      result = driver(24, 99, 0)
      println("TEST-2...${result}")
      
      result = driver(90, 23, 0)
      println("TEST-3...${result}")
      
      result = driver(44, 2, 484)
      println("TEST-4...${result}")
      
      result = driver(49, 70, 0)
      println("TEST-5...${result}")
      
      result = driver(58, 84, 0)
      println("TEST-6...${result}")
      
      result = driver(97, 34, 0)
      println("TEST-7...${result}")
      
      result = driver(99, 72, 0)
      println("TEST-8...${result}")
      
      result = driver(19, 67, 0)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: sequencesGivenLengthEveryElementEqualTwicePrevious
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn