Topics

Leetcode

4 posts

Notes on Leetcode problems, implementation techniques, Python language features, and comparisons with other programming languages.

LeetcodeAdd Two Numbers - References in Python (with C++ Comparisons)

Python variables do not store raw values directly but instead hold references to objects on the heap. This note builds a practical mental model for how references work, how they…

Coding

Leetcodetwo sum decorators

A decorator is just a callable that takes a function and returns a new one, often a wrapper, letting us extend behavior while keeping functions clean and following the…

Coding

Leetcodetwo sum type annotation

Several examples are presented to clarify the definition and application of type annotations in Python.

Coding

Leetcodetwo sum

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

Coding