title: Find Value Of Y Mod 2 Raised To Power X
signature: function find_value_of_y_mod_2_raised_to_power_x(y, x)
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 ) );
  }
question_info.entry_fn_name: find_value_of_y_mod_2_raised_to_power_x
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(y, x, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(y, x) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(57, 76, 57)
      print(string.format("TEST-0...%s",result))
  
      result = driver(80, 46, 80)
      print(string.format("TEST-1...%s",result))
  
      result = driver(84, 96, 84)
      print(string.format("TEST-2...%s",result))
  
      result = driver(35, 16, 35)
      print(string.format("TEST-3...%s",result))
  
      result = driver(3, 84, 3)
      print(string.format("TEST-4...%s",result))
  
      result = driver(42, 79, 42)
      print(string.format("TEST-5...%s",result))
  
      result = driver(7, 2, 3)
      print(string.format("TEST-6...%s",result))
  
      result = driver(99, 83, 99)
      print(string.format("TEST-7...%s",result))
  
      result = driver(13, 61, 13)
      print(string.format("TEST-8...%s",result))
  
      result = driver(44, 8, 44)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 57, "inputs": {"y": 57, "x": 76}}, {"idx": 1, "outputs": 80, "inputs": {"y": 80, "x": 46}}, {"idx": 2, "outputs": 84, "inputs": {"y": 84, "x": 96}}, {"idx": 3, "outputs": 35, "inputs": {"y": 35, "x": 16}}, {"idx": 4, "outputs": 3, "inputs": {"y": 3, "x": 84}}, {"idx": 5, "outputs": 42, "inputs": {"y": 42, "x": 79}}, {"idx": 6, "outputs": 3, "inputs": {"y": 7, "x": 2}}, {"idx": 7, "outputs": 99, "inputs": {"y": 99, "x": 83}}, {"idx": 8, "outputs": 13, "inputs": {"y": 13, "x": 61}}, {"idx": 9, "outputs": 44, "inputs": {"y": 44, "x": 8}}]