This repo contains my Python solutions to LeetCode problems. I try to give ample documentation to maximize the pedagogy of my solutions, including time and space complexity and how I arrive at them.
For expediency, when problems involve an array, I am OK with using a Python list instead and using the following operations:
for i in range(n):
to iterate over indexesfor i in range(bigger, smaller, -1):
to iterate backwardsfor num in nums:
to iterate over valuesfor i, num in enumerate(nums):
to iterate over indexes and values simultaneouslynums[-1]
to get the last element
While these operations are indeed Pythonic, they don't fundamentally provide any extra functionality over a low-level array. No shortcuts are intentionally made to evade the topic(s) or data structure(s) that the question is testing.
I very much welcome suggestions and corrections. Thanks.