Last active
May 29, 2020 12:12
-
-
Save Ch-sriram/2812981bba250d52e75d34d4db50e294 to your computer and use it in GitHub Desktop.
Given a number N, find 2^N.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Only works for 64 bit integers | |
int64_t pow2 (long long N) { | |
if (N==0) return 1; | |
return 1LL << N; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment