title: Nth Non Fibonacci Number
signature: class Solution {
  
      public Integer nthNonFibonacciNumber(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, Integer 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(76, 85);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(91, 101);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(62, 71);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(65, 74);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(83, 93);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(57, 66);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(76, 85);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(6, 11);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(2, 6);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(86, 96);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def nth_non_fibonacci_number(n):
      prevPrev = 1
      prev = 2
      curr = 3
      while (n > 0):
          prevPrev = prev
          prev = curr
          curr = (prevPrev + prev)
          n = (n - ((curr - prev) - 1))
      n = (n + ((curr - prev) - 1))
      return (prev + n)
source_cpp: int nth_non_fibonacci_number(int n) {
    int prevPrev = 1, prev = 2, curr = 3;
    while ( n > 0 ) {
      prevPrev = prev;
      prev = curr;
      curr = prevPrev + prev;
      n = n - ( curr - prev - 1 );
    }
    n = n + ( curr - prev - 1 );
    return prev + n;
  }