Easy to understand by Java, and o(n) time complexity ! but only defeat 20%! and after I change the Math.pow(2,n) to (1 << n), defeat 51% immediately!


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.