You are viewing a single comment's thread. Return to all comments →
can anyone tell me why am I getting termination due to timeout for the following code
test = int(input()) for i in range(test): num = int(input()) answer = (2**(num+1)) + 2 print(answer % 1000000007)
is there a way to do it even faster
num can be as large as 10**9, think about taking power of a number in a fast way..
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Sherlock and Square
You are viewing a single comment's thread. Return to all comments →
can anyone tell me why am I getting termination due to timeout for the following code
is there a way to do it even faster
num can be as large as 10**9, think about taking power of a number in a fast way..