title: Zeckendorfs Theorem Non Neighbouring Fibonacci Representation
signature: function zeckendorfsTheoremNonNeighbouringFibonacciRepresentation(n: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(54, 34);
    console.log(`TEST-0...${result}`);
  
    result = driver(71, 55);
    console.log(`TEST-1...${result}`);
  
    result = driver(64, 55);
    console.log(`TEST-2...${result}`);
  
    result = driver(71, 55);
    console.log(`TEST-3...${result}`);
  
    result = driver(96, 89);
    console.log(`TEST-4...${result}`);
  
    result = driver(43, 34);
    console.log(`TEST-5...${result}`);
  
    result = driver(70, 55);
    console.log(`TEST-6...${result}`);
  
    result = driver(94, 89);
    console.log(`TEST-7...${result}`);
  
    result = driver(95, 89);
    console.log(`TEST-8...${result}`);
  
    result = driver(69, 55);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def zeckendorfs_theorem_non_neighbouring_fibonacci_representation(n):
      if ((n == 0) or (n == 1)):
          return n
      (f1, f2, f3) = (0, 1, 1)
      while (f3 <= n):
          f1 = f2
          f2 = f3
          f3 = (f1 + f2)
      return f2
source_cpp: int zeckendorfs_theorem_non_neighbouring_fibonacci_representation(int n) {
    if ( n == 0 || n == 1 ) return n;
    int f1 = 0, f2 = 1, f3 = 1;
    while ( f3 <= n ) {
      f1 = f2;
      f2 = f3;
      f3 = f1 + f2;
    }
    return f2;
  }