title: Find Value Of Y Mod 2 Raised To Power X
signature: find_value_of_y_mod_2_raised_to_power_x <- function(y, x) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(y, x, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(y, x), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          57L, 76L, 
          57L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          80L, 46L, 
          80L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          84L, 96L, 
          84L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          35L, 16L, 
          35L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          3L, 84L, 
          3L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          42L, 79L, 
          42L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          7L, 2L, 
          3L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          99L, 83L, 
          99L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          13L, 61L, 
          13L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          44L, 8L, 
          44L
      )))
  
  }
  
  main()
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 ) );
  }