title: Leonardo Number 1
signature: class Solution {
  
      public Long leonardoNumber1(Integer n) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Long expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(75, 6832909245813413L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(76, 11055879401769513L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(55, 451702867433L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(14, 1219L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(43, 1402817465L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(10, 177L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(16, 3193L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(30, 2692537L);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(44, 2269806339L);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(65, 55555780070575L);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Long expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Long actual, Long expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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 ];
  }