title: Find Unit Digit X Raised Power Y
signature: function findUnitDigitXRaisedPowerY(x: number, y: number): number {
source_py: def find_unit_digit_x_raised_power_y(x, y):
      res = 1
      for i in range(y):
          res = ((res * x) % 10)
      return res
source_cpp: int find_unit_digit_x_raised_power_y(int x, int y) {
    int res = 1;
    for ( int i = 0;
    i < y;
    i ++ ) res = ( res * x ) % 10;
    return res;
  }
question_info.test_list: [{"idx": 0, "outputs": 7, "inputs": {"x": 33, "y": 55}}, {"idx": 1, "outputs": 5, "inputs": {"x": 95, "y": 7}}, {"idx": 2, "outputs": 1, "inputs": {"x": 21, "y": 63}}, {"idx": 3, "outputs": 9, "inputs": {"x": 3, "y": 62}}, {"idx": 4, "outputs": 0, "inputs": {"x": 40, "y": 53}}, {"idx": 5, "outputs": 6, "inputs": {"x": 64, "y": 24}}, {"idx": 6, "outputs": 3, "inputs": {"x": 17, "y": 23}}, {"idx": 7, "outputs": 4, "inputs": {"x": 58, "y": 74}}, {"idx": 8, "outputs": 4, "inputs": {"x": 44, "y": 13}}, {"idx": 9, "outputs": 9, "inputs": {"x": 27, "y": 54}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(x: number, y: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(x, y),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(33, 55, 7);
    console.log(`TEST-0...${result}`);
  
    result = driver(95, 7, 5);
    console.log(`TEST-1...${result}`);
  
    result = driver(21, 63, 1);
    console.log(`TEST-2...${result}`);
  
    result = driver(3, 62, 9);
    console.log(`TEST-3...${result}`);
  
    result = driver(40, 53, 0);
    console.log(`TEST-4...${result}`);
  
    result = driver(64, 24, 6);
    console.log(`TEST-5...${result}`);
  
    result = driver(17, 23, 3);
    console.log(`TEST-6...${result}`);
  
    result = driver(58, 74, 4);
    console.log(`TEST-7...${result}`);
  
    result = driver(44, 13, 4);
    console.log(`TEST-8...${result}`);
  
    result = driver(27, 54, 9);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: findUnitDigitXRaisedPowerY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js