Logo for ammarahmed.ca

Leetcode

Showcasing my solutions to Leetcode problems in Go alongside my thought process and approach to solving them.

Hard
Jul 29, 2025

76. Minimum Window Substring

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t ( including duplicates) is included in the window. If there is no such substring, return the empty string "".

#sliding-window

Hard
Jul 29, 2025

239. Sliding Window Maximum

You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

#sliding-window

Medium
Jul 28, 2025

567. Permutation in String

Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise.

#sliding-window

Medium
Jul 27, 2025

19. Remove Nth Node From End of List

Given the head of a linked list, remove the nth node from the end of the list and return its head.

#linked-list
#two-pointers

Medium
Jul 25, 2025

143. Reorder List

You are given the head of a singly linked-list. The list can be represented as:

#linked-list

Medium
Jun 13, 2025

33. Search in Rotated Sorted Array

There is an integer array nums sorted in ascending order (with distinct values).

#binary-search

Easy
May 28, 2025

206. Reverse Linked List

Given the head of a singly linked list, reverse the list, and return the reversed list.

#linked-list

Medium
May 27, 2025

155. Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

#stack
#class

Medium
May 27, 2025

74. Search a 2D Matrix

You are given an m x n integer matrix matrix with the following two properties:

#binary-search

Medium
May 25, 2025

238. Product of Array Except Self

Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

#arrays
#math