title: Find Unit Digit X Raised Power Y
signature: class Solution {
  
      public Integer findUnitDigitXRaisedPowerY(Integer x, Integer y) {
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.extension: java
question_info.entry_fn_name: findUnitDigitXRaisedPowerY
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer x, Integer y, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(x, y,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(33, 55, 7);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(95, 7, 5);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(21, 63, 1);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(3, 62, 9);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(40, 53, 0);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(64, 24, 6);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(17, 23, 3);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(58, 74, 4);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(44, 13, 4);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(27, 54, 9);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer x, Integer y, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(x, y),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__