Skip to content

kndo/leetcode-python

Repository files navigation

LeetCode Python Solutions

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 indexes
  • for i in range(bigger, smaller, -1): to iterate backwards
  • for num in nums: to iterate over values
  • for i, num in enumerate(nums): to iterate over indexes and values simultaneously
  • nums[-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.

Releases

No releases published

Packages

No packages published

Languages