title: Find Value Of Y Mod 2 Raised To Power X
signature: func findValueOfYMod2RaisedToPowerX(y int, x int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(y int, x int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(y, x),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(57, 
  	76, 57)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(80, 
  	46, 80)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(84, 
  	96, 84)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(35, 
  	16, 35)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(3, 
  	84, 3)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(42, 
  	79, 42)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(7, 
  	2, 3)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(99, 
  	83, 99)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(13, 
  	61, 13)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(44, 
  	8, 44)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 ) );
  }