LeetCode 136 – Python 3 (Week 2 – 09)

Solution 1 Time complexity is O(n). Space complexity is O(1). Solution 2 Time complexity is O(n*n). Iterating through nums takes O(n) time * search num in the list takes O(n) time. Space complexity is O(n). n is the size of the list. Solution 3 Time complexity is O(n). Iterating through nums takes O(n) time * search num in the dictionary takes […]

Create your website at WordPress.com
Get started