title: Find Unit Digit X Raised Power Y 1
signature: find_unit_digit_x_raised_power_y_1 <- function(x, y) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(x, y, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(x, y), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          37L, 17L, 
          7L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          70L, 52L, 
          0L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          26L, 23L, 
          6L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          9L, 96L, 
          1L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          82L, 71L, 
          8L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          95L, 36L, 
          5L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          43L, 40L, 
          1L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          7L, 27L, 
          3L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          19L, 56L, 
          1L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          49L, 28L, 
          1L
      )))
  
  }
  
  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 );
  }