title: Find N Th Element From Sterns Diatomic Series
signature: pub fn find_n_th_element_from_sterns_diatomic_series(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(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        37, 
        11
      ));
      
      println!("TEST-1...{}", driver(
        24, 
        2
      ));
      
      println!("TEST-2...{}", driver(
        13, 
        5
      ));
      
      println!("TEST-3...{}", driver(
        56, 
        3
      ));
      
      println!("TEST-4...{}", driver(
        26, 
        5
      ));
      
      println!("TEST-5...{}", driver(
        67, 
        11
      ));
      
      println!("TEST-6...{}", driver(
        82, 
        11
      ));
      
      println!("TEST-7...{}", driver(
        60, 
        4
      ));
      
      println!("TEST-8...{}", driver(
        64, 
        1
      ));
      
      println!("TEST-9...{}", driver(
        65, 
        7
      ));
      
  }
source_py: def find_n_th_element_from_sterns_diatomic_series(n):
      DP = ([0] * (n + 1))
      DP[0] = 0
      DP[1] = 1
      for i in range(2, (n + 1)):
          if (int((i % 2)) == 0):
              DP[i] = DP[int((i / 2))]
          else:
              DP[i] = (DP[int(((i - 1) / 2))] + DP[int(((i + 1) / 2))])
      return DP[n]
source_cpp: int find_n_th_element_from_sterns_diatomic_series(int n) {
    int DP [ n + 1 ];
    DP [ 0 ] = 0;
    DP [ 1 ] = 1;
    for ( int i = 2;
    i <= n;
    i ++ ) {
      if ( i % 2 == 0 ) DP [ i ] = DP [ i / 2 ];
      else DP [ i ] = DP [ ( i - 1 ) / 2 ] + DP [ ( i + 1 ) / 2 ];
    }
    return DP [ n ];
  }