title: Fibonacci Modulo P
signature: function fibonacci_modulo_p(p)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(p, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(p), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(51, 36);
      @printf("TEST-0...%s\n",result);
      
      result = driver(40, 30);
      @printf("TEST-1...%s\n",result);
      
      result = driver(68, 18);
      @printf("TEST-2...%s\n",result);
      
      result = driver(7, 8);
      @printf("TEST-3...%s\n",result);
      
      result = driver(8, 6);
      @printf("TEST-4...%s\n",result);
      
      result = driver(32, 24);
      @printf("TEST-5...%s\n",result);
      
      result = driver(93, 60);
      @printf("TEST-6...%s\n",result);
      
      result = driver(75, 100);
      @printf("TEST-7...%s\n",result);
      
      result = driver(71, 70);
      @printf("TEST-8...%s\n",result);
      
      result = driver(15, 20);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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;
  }