title: Find Value Of Y Mod 2 Raised To Power X
signature: class Solution {
  
      public Integer findValueOfYMod2RaisedToPowerX(Integer y, Integer x) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer y, Integer x, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(y, x,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(57, 76, 57);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(80, 46, 80);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(84, 96, 84);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(35, 16, 35);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(3, 84, 3);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(42, 79, 42);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(7, 2, 3);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(99, 83, 99);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(13, 61, 13);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(44, 8, 44);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer y, Integer x, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(y, x),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def find_value_of_y_mod_2_raised_to_power_x(y, x):
      return (y % pow(2, x))
source_cpp: long long int find_value_of_y_mod_2_raised_to_power_x(long long int y, long long int x) {
    if ( log2 ( y ) < x ) return y;
    if ( x > 63 ) return y;
    return ( y % ( 1 << x ) );
  }