title: Find Unit Digit X Raised Power Y 1
signature: func findUnitDigitXRaisedPowerY1(x int, y int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(x int, y int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(x, y),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(37, 
  	17, 7)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(70, 
  	52, 0)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(26, 
  	23, 6)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(9, 
  	96, 1)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(82, 
  	71, 8)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(95, 
  	36, 5)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(43, 
  	40, 1)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(7, 
  	27, 3)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(19, 
  	56, 1)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(49, 
  	28, 1)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 );
  }