title: Leonardo Number 1
signature: func leonardoNumber1(n int) int64 {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int64, expected int64) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int64) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(75, 6832909245813413)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(76, 11055879401769513)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(55, 451702867433)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(14, 1219)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(43, 1402817465)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(10, 177)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(16, 3193)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(30, 2692537)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(44, 2269806339)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(65, 55555780070575)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def leonardo_number_1(n):
      dp = []
      dp.append(1)
      dp.append(1)
      for i in range(2, (n + 1)):
          dp.append(((dp[(i - 1)] + dp[(i - 2)]) + 1))
      return dp[n]
source_cpp: int leonardo_number_1(int n) {
    int dp [ n + 1 ];
    dp [ 0 ] = dp [ 1 ] = 1;
    for ( int i = 2;
    i <= n;
    i ++ ) dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] + 1;
    return dp [ n ];
  }