title: Find Unit Digit X Raised Power Y 1
signature: function findUnitDigitXRaisedPowerY1($x, $y) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($x, $y, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($x, $y), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        37, 17, 
        7));
      
      printf("TEST-1...%s\n",driver(
        70, 52, 
        0));
      
      printf("TEST-2...%s\n",driver(
        26, 23, 
        6));
      
      printf("TEST-3...%s\n",driver(
        9, 96, 
        1));
      
      printf("TEST-4...%s\n",driver(
        82, 71, 
        8));
      
      printf("TEST-5...%s\n",driver(
        95, 36, 
        5));
      
      printf("TEST-6...%s\n",driver(
        43, 40, 
        1));
      
      printf("TEST-7...%s\n",driver(
        7, 27, 
        3));
      
      printf("TEST-8...%s\n",driver(
        19, 56, 
        1));
      
      printf("TEST-9...%s\n",driver(
        49, 28, 
        1));
      
  }
  
  main();
  ?>
source_py: def find_unit_digit_x_raised_power_y_1(x, y):
      x = (x % 10)
      if (y != 0):
          y = ((y % 4) + 4)
      return (int(math.pow(x, y)) % 10)
source_cpp: int find_unit_digit_x_raised_power_y_1(int x, int y) {
    x = x % 10;
    if ( y != 0 ) y = y % 4 + 4;
    return ( ( ( int ) ( pow ( x, y ) ) ) % 10 );
  }