LeetCode 202 – Python 3 (Week 06 – 03)

Solution 1 Time complexity is O(1). Space complexity is O(1). Solution 2 Time complexity is O(1). Space complexity is O(1). How to calculate the complexity? Input is a positive integer. Assume it is 32 bit. So we calculate maximum of 10 digits. Assume it is maximum 10 digits 9^2 +9^2…. The sum is 10*81 = …

Design a site like this with WordPress.com
Get started