Home
Gaurav's GitHub Page
Cancel

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: ...

3 sum

This question is part of NeetCode150 series. Problem Description Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i]...

Right Smaller Than

PROBLEM DESCRIPTION Write a function that takes in an array of integers and returns an array of the same length where each element in the output array corresponds to the number of integers in the ...