title: Find Unit Digit X Raised Power Y 1
signature: def findUnitDigitXRaisedPowerY1(x: Int, y: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(x: Int, y: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(x, y),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        37, 17, 
        7    
      )}")   
  
  
      println(s"TEST-1...${driver(
        70, 52, 
        0    
      )}")   
  
  
      println(s"TEST-2...${driver(
        26, 23, 
        6    
      )}")   
  
  
      println(s"TEST-3...${driver(
        9, 96, 
        1    
      )}")   
  
  
      println(s"TEST-4...${driver(
        82, 71, 
        8    
      )}")   
  
  
      println(s"TEST-5...${driver(
        95, 36, 
        5    
      )}")   
  
  
      println(s"TEST-6...${driver(
        43, 40, 
        1    
      )}")   
  
  
      println(s"TEST-7...${driver(
        7, 27, 
        3    
      )}")   
  
  
      println(s"TEST-8...${driver(
        19, 56, 
        1    
      )}")   
  
  
      println(s"TEST-9...${driver(
        49, 28, 
        1    
      )}")   
  
  }
  
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 );
  }