title: Modular Exponentiation Power In Modular Arithmetic
signature: def modular_exponentiation_power_in_modular_arithmetic(x, y, p):
source_py: def modular_exponentiation_power_in_modular_arithmetic(x, y, p):
      res = 1
      x = (x % p)
      while (y > 0):
          if ((y & 1) == 1):
              res = ((res * x) % p)
          y = (y >> 1)
          x = ((x * x) % p)
      return res
source_cpp: int modular_exponentiation_power_in_modular_arithmetic(int x, unsigned int y, int p) {
    int res = 1;
    x = x % p;
    while ( y > 0 ) {
      if ( y & 1 ) res = ( res * x ) % p;
      y = y >> 1;
      x = ( x * x ) % p;
    }
    return res;
  }
question_info.test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(x, y, p, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              x, y, p),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver(45, 5, 68, 61)
      print(f"TEST-0...{result}")
  
      result = driver(67, 25, 49, 18)
      print(f"TEST-1...{result}")
  
      result = driver(26, 91, 44, 4)
      print(f"TEST-2...{result}")
  
      result = driver(33, 61, 9, 0)
      print(f"TEST-3...{result}")
  
      result = driver(35, 8, 13, 3)
      print(f"TEST-4...{result}")
  
      result = driver(68, 41, 5, 3)
      print(f"TEST-5...{result}")
  
      result = driver(14, 76, 20, 16)
      print(f"TEST-6...{result}")
  
      result = driver(5, 89, 13, 5)
      print(f"TEST-7...{result}")
  
      result = driver(23, 42, 45, 19)
      print(f"TEST-8...{result}")
  
      result = driver(37, 63, 56, 29)
      print(f"TEST-9...{result}")
  
      sys.exit(0)
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.entry_fn_name: modular_exponentiation_power_in_modular_arithmetic
question_info.test_list: [{"idx": 0, "outputs": 61, "inputs": {"x": 45, "y": 5, "p": 68}}, {"idx": 1, "outputs": 18, "inputs": {"x": 67, "y": 25, "p": 49}}, {"idx": 2, "outputs": 4, "inputs": {"x": 26, "y": 91, "p": 44}}, {"idx": 3, "outputs": 0, "inputs": {"x": 33, "y": 61, "p": 9}}, {"idx": 4, "outputs": 3, "inputs": {"x": 35, "y": 8, "p": 13}}, {"idx": 5, "outputs": 3, "inputs": {"x": 68, "y": 41, "p": 5}}, {"idx": 6, "outputs": 16, "inputs": {"x": 14, "y": 76, "p": 20}}, {"idx": 7, "outputs": 5, "inputs": {"x": 5, "y": 89, "p": 13}}, {"idx": 8, "outputs": 19, "inputs": {"x": 23, "y": 42, "p": 45}}, {"idx": 9, "outputs": 29, "inputs": {"x": 37, "y": 63, "p": 56}}]
question_info.entry_cls_name: Solution