title: Find N Th Element From Sterns Diatomic Series
signature: fun findNThElementFromSternsDiatomicSeries(n: Int): Int {
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(n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(37, 11)
      println("TEST-0...${result}")
      
      result = driver(24, 2)
      println("TEST-1...${result}")
      
      result = driver(13, 5)
      println("TEST-2...${result}")
      
      result = driver(56, 3)
      println("TEST-3...${result}")
      
      result = driver(26, 5)
      println("TEST-4...${result}")
      
      result = driver(67, 11)
      println("TEST-5...${result}")
      
      result = driver(82, 11)
      println("TEST-6...${result}")
      
      result = driver(60, 4)
      println("TEST-7...${result}")
      
      result = driver(64, 1)
      println("TEST-8...${result}")
      
      result = driver(65, 7)
      println("TEST-9...${result}")
      
          
  }
  
  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 ];
  }