title: Padovan Sequence
signature: function padovanSequence(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(1, 1);
    console.log(`TEST-0...${result}`);
  
    result = driver(92, 124155792775);
    console.log(`TEST-1...${result}`);
  
    result = driver(29, 2513);
    console.log(`TEST-2...${result}`);
  
    result = driver(52, 1618192);
    console.log(`TEST-3...${result}`);
  
    result = driver(55, 3761840);
    console.log(`TEST-4...${result}`);
  
    result = driver(13, 28);
    console.log(`TEST-5...${result}`);
  
    result = driver(83, 9882257736);
    console.log(`TEST-6...${result}`);
  
    result = driver(83, 9882257736);
    console.log(`TEST-7...${result}`);
  
    result = driver(10, 12);
    console.log(`TEST-8...${result}`);
  
    result = driver(67, 109870576);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def padovan_sequence(n):
      (pPrevPrev, pPrev, pCurr, pNext) = (1, 1, 1, 1)
      for i in range(3, (n + 1)):
          pNext = (pPrevPrev + pPrev)
          pPrevPrev = pPrev
          pPrev = pCurr
          pCurr = pNext
      return pNext
source_cpp: int padovan_sequence(int n) {
    int pPrevPrev = 1, pPrev = 1, pCurr = 1, pNext = 1;
    for ( int i = 3;
    i <= n;
    i ++ ) {
      pNext = pPrevPrev + pPrev;
      pPrevPrev = pPrev;
      pPrev = pCurr;
      pCurr = pNext;
    }
    return pNext;
  }