title: Find N Th Element From Sterns Diatomic Series
signature: def findNThElementFromSternsDiatomicSeries(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(n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        37, 
        11    
      )}")   
  
  
      println(s"TEST-1...${driver(
        24, 
        2    
      )}")   
  
  
      println(s"TEST-2...${driver(
        13, 
        5    
      )}")   
  
  
      println(s"TEST-3...${driver(
        56, 
        3    
      )}")   
  
  
      println(s"TEST-4...${driver(
        26, 
        5    
      )}")   
  
  
      println(s"TEST-5...${driver(
        67, 
        11    
      )}")   
  
  
      println(s"TEST-6...${driver(
        82, 
        11    
      )}")   
  
  
      println(s"TEST-7...${driver(
        60, 
        4    
      )}")   
  
  
      println(s"TEST-8...${driver(
        64, 
        1    
      )}")   
  
  
      println(s"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 ];
  }