title: Compute Modulus Division By A Power Of 2 Number
signature: function computeModulusDivisionByAPowerOf2Number(n: number, d: number): number {
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(n: number, d: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n, d),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(54, 59, 50);
    console.log(`TEST-0...${result}`);
  
    result = driver(39, 84, 3);
    console.log(`TEST-1...${result}`);
  
    result = driver(35, 81, 0);
    console.log(`TEST-2...${result}`);
  
    result = driver(9, 60, 9);
    console.log(`TEST-3...${result}`);
  
    result = driver(62, 68, 2);
    console.log(`TEST-4...${result}`);
  
    result = driver(16, 16, 0);
    console.log(`TEST-5...${result}`);
  
    result = driver(93, 96, 93);
    console.log(`TEST-6...${result}`);
  
    result = driver(32, 38, 32);
    console.log(`TEST-7...${result}`);
  
    result = driver(39, 62, 37);
    console.log(`TEST-8...${result}`);
  
    result = driver(63, 16, 15);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
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 ) );
  }