title: Find Unit Digit X Raised Power Y 1
signature: function find_unit_digit_x_raised_power_y_1(x, y)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(x, y, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(x, y), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(37, 17, 7);
      @printf("TEST-0...%s\n",result);
      
      result = driver(70, 52, 0);
      @printf("TEST-1...%s\n",result);
      
      result = driver(26, 23, 6);
      @printf("TEST-2...%s\n",result);
      
      result = driver(9, 96, 1);
      @printf("TEST-3...%s\n",result);
      
      result = driver(82, 71, 8);
      @printf("TEST-4...%s\n",result);
      
      result = driver(95, 36, 5);
      @printf("TEST-5...%s\n",result);
      
      result = driver(43, 40, 1);
      @printf("TEST-6...%s\n",result);
      
      result = driver(7, 27, 3);
      @printf("TEST-7...%s\n",result);
      
      result = driver(19, 56, 1);
      @printf("TEST-8...%s\n",result);
      
      result = driver(49, 28, 1);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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 );
  }