You are viewing a single comment's thread. Return to all comments →
return (pow(2,n+1,1000000007)+2)%1000000007
Python's pow() is made for this.
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 →
return (pow(2,n+1,1000000007)+2)%1000000007
Python's pow() is made for this.