title: Fibonacci Modulo P
signature: fun fibonacciModuloP(p: Int): Int {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 36, "inputs": {"p": 51}}, {"idx": 1, "outputs": 30, "inputs": {"p": 40}}, {"idx": 2, "outputs": 18, "inputs": {"p": 68}}, {"idx": 3, "outputs": 8, "inputs": {"p": 7}}, {"idx": 4, "outputs": 6, "inputs": {"p": 8}}, {"idx": 5, "outputs": 24, "inputs": {"p": 32}}, {"idx": 6, "outputs": 60, "inputs": {"p": 93}}, {"idx": 7, "outputs": 100, "inputs": {"p": 75}}, {"idx": 8, "outputs": 70, "inputs": {"p": 71}}, {"idx": 9, "outputs": 20, "inputs": {"p": 15}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(p: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(p), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(51, 36)
      println("TEST-0...${result}")
      
      result = driver(40, 30)
      println("TEST-1...${result}")
      
      result = driver(68, 18)
      println("TEST-2...${result}")
      
      result = driver(7, 8)
      println("TEST-3...${result}")
      
      result = driver(8, 6)
      println("TEST-4...${result}")
      
      result = driver(32, 24)
      println("TEST-5...${result}")
      
      result = driver(93, 60)
      println("TEST-6...${result}")
      
      result = driver(75, 100)
      println("TEST-7...${result}")
      
      result = driver(71, 70)
      println("TEST-8...${result}")
      
      result = driver(15, 20)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: fibonacciModuloP
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn