title: Fibonacci Modulo P
signature: class Solution {
  
      public Integer fibonacciModuloP(Integer p) {
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.extension: java
question_info.entry_fn_name: fibonacciModuloP
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer p, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(p,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(51, 36);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(40, 30);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(68, 18);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(7, 8);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(8, 6);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(32, 24);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(93, 60);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(75, 100);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(71, 70);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(15, 20);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer p, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(p),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__