Problem Description Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key’s value at a certain timestamp. Impl...
Find Minimum in Rotated Sorted Array
PROBLEM DESCRIPTION Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: [4,5,6,7,0,1,2] if it w...
Largest Rectangle in Histogram
Problem Description Given an array of integers heights representing the histogram’s bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. leetcod...
Car Fleet
PROBLEM DESCRIPTION There are n cars going to the same destination along a one-lane road. The destination is target miles away. You are given two integer array position and speed, both of length ...
Daily Temperatures
PROBLEM DESCRIPTION Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day t...
Generate Parentheses
Problem Description Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. leetcode Solution NeetCode Youtube class Solution { public List...
Determine if Two Strings Are Close
Problem Description Two strings are considered close if you can attain one from the other using the following operations: Operation 1: Swap any two existing characters. For example, abcd...
Evaluate Reverse Polish Notation
Problem Description Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, and /. Each operand may be an integer or another expression. Note that...
Graph Valid Tree
Problem Description You have a graph of n nodes labeled from 0 to n - 1. You are given an integer n and a list of edges where edges[i] = [ai, bi] indicates that there is an undirected edge between...
Clone Graph
Problem Description Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contains a value (int) and a list (List[Node]) of...