title: Find Unit Digit X Raised Power Y 1
signature: fun findUnitDigitXRaisedPowerY1(x: Int, y: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(x: Int, y: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(x, y), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(37, 17, 7)
      println("TEST-0...${result}")
      
      result = driver(70, 52, 0)
      println("TEST-1...${result}")
      
      result = driver(26, 23, 6)
      println("TEST-2...${result}")
      
      result = driver(9, 96, 1)
      println("TEST-3...${result}")
      
      result = driver(82, 71, 8)
      println("TEST-4...${result}")
      
      result = driver(95, 36, 5)
      println("TEST-5...${result}")
      
      result = driver(43, 40, 1)
      println("TEST-6...${result}")
      
      result = driver(7, 27, 3)
      println("TEST-7...${result}")
      
      result = driver(19, 56, 1)
      println("TEST-8...${result}")
      
      result = driver(49, 28, 1)
      println("TEST-9...${result}")
      
          
  }
  
  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 );
  }