title: Fibonacci Modulo P
signature: function fibonacciModuloP(p: 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(p: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(p),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(51, 36);
    console.log(`TEST-0...${result}`);
  
    result = driver(40, 30);
    console.log(`TEST-1...${result}`);
  
    result = driver(68, 18);
    console.log(`TEST-2...${result}`);
  
    result = driver(7, 8);
    console.log(`TEST-3...${result}`);
  
    result = driver(8, 6);
    console.log(`TEST-4...${result}`);
  
    result = driver(32, 24);
    console.log(`TEST-5...${result}`);
  
    result = driver(93, 60);
    console.log(`TEST-6...${result}`);
  
    result = driver(75, 100);
    console.log(`TEST-7...${result}`);
  
    result = driver(71, 70);
    console.log(`TEST-8...${result}`);
  
    result = driver(15, 20);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def fibonacci_modulo_p(p):
      first = 1
      second = 1
      number = 2
      next = 1
      while next:
          next = ((first + second) % p)
          first = second
          second = next
          number = (number + 1)
      return number
source_cpp: int fibonacci_modulo_p(int p) {
    int first = 1, second = 1, number = 2, next = 1;
    while ( next ) {
      next = ( first + second ) % p;
      first = second;
      second = next;
      number ++;
    }
    return number;
  }