Leetcode
Showcasing my solutions to Leetcode problems in Go alongside my thought process and approach to solving them.
146. LRU Cache
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.
104. Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth.
56. Merge Intervals
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.
200. Number of Islands
Given an m x n 2D binary grid grid which represents a map of '1' s (land) and '0' s (water), return the number of islands.
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 "".
567. Permutation in String
Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise.
21. Merge Two Sorted Lists
You are given the heads of two sorted linked lists list1 and list2.
3. Longest Substring Without Repeating Characters
Given a string s, find the length of the longest substring without duplicate characters.
155. Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
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].