title: Compute Modulus Division By A Power Of 2 Number
signature: class Solution {
  
      public Integer computeModulusDivisionByAPowerOf2Number(Integer n, Integer d) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer d, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n, d,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(54, 59, 50);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(39, 84, 3);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(35, 81, 0);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(9, 60, 9);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(62, 68, 2);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(16, 16, 0);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(93, 96, 93);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(32, 38, 32);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(39, 62, 37);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(63, 16, 15);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer d, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n, d),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def compute_modulus_division_by_a_power_of_2_number(n, d):
      return (n & (d - 1))
source_cpp: unsigned int compute_modulus_division_by_a_power_of_2_number(unsigned int n, unsigned int d) {
    return ( n & ( d - 1 ) );
  }