title: Fibonacci Modulo P
signature: fibonacci_modulo_p <- function(p) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(p, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(p), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          51L, 
          36L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          40L, 
          30L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          68L, 
          18L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          7L, 
          8L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          8L, 
          6L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          32L, 
          24L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          93L, 
          60L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          75L, 
          100L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          71L, 
          70L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          15L, 
          20L
      )))
  
  }
  
  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;
  }