title: Sequences Given Length Every Element Equal Twice Previous
signature: pub fn sequences_given_length_every_element_equal_twice_previous(m: i32, n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(m: i32, n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(m, n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        38, 34, 
        0
      ));
      
      println!("TEST-1...{}", driver(
        39, 29, 
        0
      ));
      
      println!("TEST-2...{}", driver(
        24, 99, 
        0
      ));
      
      println!("TEST-3...{}", driver(
        90, 23, 
        0
      ));
      
      println!("TEST-4...{}", driver(
        44, 2, 
        484
      ));
      
      println!("TEST-5...{}", driver(
        49, 70, 
        0
      ));
      
      println!("TEST-6...{}", driver(
        58, 84, 
        0
      ));
      
      println!("TEST-7...{}", driver(
        97, 34, 
        0
      ));
      
      println!("TEST-8...{}", driver(
        99, 72, 
        0
      ));
      
      println!("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 );
  }