title: Find N Th Element From Sterns Diatomic Series
signature: function find_n_th_element_from_sterns_diatomic_series(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(37, 11);
      @printf("TEST-0...%s\n",result);
      
      result = driver(24, 2);
      @printf("TEST-1...%s\n",result);
      
      result = driver(13, 5);
      @printf("TEST-2...%s\n",result);
      
      result = driver(56, 3);
      @printf("TEST-3...%s\n",result);
      
      result = driver(26, 5);
      @printf("TEST-4...%s\n",result);
      
      result = driver(67, 11);
      @printf("TEST-5...%s\n",result);
      
      result = driver(82, 11);
      @printf("TEST-6...%s\n",result);
      
      result = driver(60, 4);
      @printf("TEST-7...%s\n",result);
      
      result = driver(64, 1);
      @printf("TEST-8...%s\n",result);
      
      result = driver(65, 7);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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 ];
  }