This question is part of NeetCode150 series. Problem Description Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back ...
Product of Array Except Self
This question is part of NeetCode150 series. Problem Description 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...
Design Add and Search Words Data Structure
This question is part of NeetCode150 series. Problem Description Design a data structure that supports adding new words and finding if a string matches any previously added string. Implement the...
Implement Trie (Prefix Tree)
This question is part of NeetCode150 series. Problem Description A trie (pronounced as “try”) or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of s...
Top K Frequent Elements
This question is part of NeetCode150 series. Problem Description Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. leetcod...
Group Anagrams
This question is part of NeetCode150 series. Problem Description Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phras...
Two Sum
This question is part of NeetCode150 series. Problem Description Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may ...
Valid Anagram
This question is part of NeetCode150 series. Problem Description Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rear...
Contains Duplicate
This question is part of NeetCode150 series. Problem Description Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is di...
Min Stack
This question is part of NeetCode150 series. PROBLEM DESCRIPTION Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: ...