Test cases
|
|
Solution 1: TLE
Brute force, TLE with no doubt.
Time: O(n)
Space: O(1)
|
|
Solution 2: accepted 38ms 72.8%
Double the base if we can, decrease the time complexity to approximately logn.
Time: O(logn)
Space: O(1)
|
|
|
|
Brute force, TLE with no doubt.
Time: O(n)
Space: O(1)
|
|
Double the base if we can, decrease the time complexity to approximately logn.
Time: O(logn)
Space: O(1)
|
|