title: Nth Non Fibonacci Number
signature: nth_non_fibonacci_number <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          76L, 
          85L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          91L, 
          101L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          62L, 
          71L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          65L, 
          74L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          83L, 
          93L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          57L, 
          66L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          76L, 
          85L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          6L, 
          11L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          2L, 
          6L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          86L, 
          96L
      )))
  
  }
  
  main()
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;
  }