Hash Table | LeetCode Problems

291 Hash Table solutions to LeetCode solutions.

Hash Table Problems View all solutions →

Two Sum

#1 Easy

Longest Substring Without Repeating Characters

#3 Medium

Integer to Roman

#12 Medium

Roman to Integer

#13 Easy

Letter Combinations of a Phone Number

#17 Medium

Substring with Concatenation of All Words

#30 Hard

Valid Sudoku

#36 Medium

Sudoku Solver

#37 Hard

First Missing Positive

#41 Hard

Group Anagrams

#49 Medium

Set Matrix Zeroes

#73 Medium

Minimum Window Substring

#76 Hard

Construct Binary Tree from Preorder and Inorder Traversal

#105 Medium

Construct Binary Tree from Inorder and Postorder Traversal

#106 Medium

Word Ladder II

#126 Hard

Word Ladder

#127 Hard

Longest Consecutive Sequence

#128 Medium

Clone Graph

#133 Medium

Copy List with Random Pointer

#138 Medium

Word Break

#139 Medium

Word Break II

#140 Hard

Linked List Cycle

#141 Easy

Linked List Cycle II

#142 Medium

LRU Cache

#146 Medium

Max Points on a Line

#149 Hard

Intersection of Two Linked Lists

#160 Medium

Fraction to Recurring Decimal

#166 Medium

Majority Element

#169 Easy

Repeated DNA Sequences

#187 Medium

Happy Number

#202 Easy

Isomorphic Strings

#205 Easy

Implement Trie (Prefix Tree)

#208 Medium

Contains Duplicate

#217 Easy

Contains Duplicate II

#219 Easy

Majority Element II

#229 Medium

Valid Anagram

#242 Easy

Ugly Number II

#264 Medium

Missing Number

#268 Easy

Word Pattern

#290 Easy

Bulls and Cows

#299 Medium

Palindrome Pairs

#336 Hard

Top K Frequent Elements

#347 Medium

Intersection of Two Arrays

#349 Easy

Intersection of Two Arrays II

#350 Easy

Design Twitter

#355 Medium

Insert Delete GetRandom O(1)

#380 Medium

Insert Delete GetRandom O(1) - Duplicates allowed

#381 Hard

Ransom Note

#383 Easy

First Unique Character in a String

#387 Easy

Find the Difference

#389 Easy

Longest Substring with At Least K Repeating Characters

#395 Medium

Random Pick Index

#398 Medium

Longest Palindrome

#409 Easy

Maximum XOR of Two Numbers in an Array

#421 Medium

Reconstruct Original Digits from English

#423 Medium

Longest Repeating Character Replacement

#424 Medium

All O`one Data Structure

#432 Hard

Minimum Genetic Mutation

#433 Medium

Find All Anagrams in a String

#438 Medium

Find All Duplicates in an Array

#442 Medium

Number of Boomerangs

#447 Medium

Find All Numbers Disappeared in an Array

#448 Easy

Sort Characters By Frequency

#451 Medium

4Sum II

#454 Medium

Circular Array Loop

#457 Medium

LFU Cache

#460 Hard

Sliding Window Median

#480 Hard

Non-decreasing Subsequences

#491 Medium

Next Greater Element I

#496 Easy

Keyboard Row

#500 Easy

Most Frequent Subtree Sum

#508 Medium

Random Flip Matrix

#519 Medium

Longest Uncommon Subsequence II

#522 Medium

Continuous Subarray Sum

#523 Medium

Contiguous Array

#525 Medium

K-diff Pairs in an Array

#532 Medium

Encode and Decode TinyURL

#535 Medium

Brick Wall

#554 Medium

Subarray Sum Equals K

#560 Medium

Permutation in String

#567 Medium

Distribute Candies

#575 Easy

Longest Harmonious Subsequence

#594 Easy

Minimum Index Sum of Two Lists

#599 Easy

Find Duplicate File in System

#609 Medium

Task Scheduler

#621 Medium

Smallest Range Covering Elements from K Lists

#632 Hard

Set Mismatch

#645 Medium

Replace Words

#648 Medium

Find Duplicate Subtrees

#652 Medium

Two Sum IV - Input is a BST

#653 Easy

Split Array into Consecutive Subsequences

#659 Medium

Implement Magic Dictionary

#676 Medium

Map Sum Pairs

#677 Medium

Employee Importance

#690 Medium

Stickers to Spell Word

#691 Hard

Top K Frequent Words

#692 Medium

Degree of an Array

#697 Easy

Design HashSet

#705 Easy

Design HashMap

#706 Easy

Random Pick with Blacklist

#710 Hard

Longest Word in Dictionary

#720 Medium

Accounts Merge

#721 Medium

Number of Atoms

#726 Hard

Parse Lisp Expression

#736 Hard

Delete and Earn

#740 Medium

Prefix and Suffix Search

#745 Hard

Shortest Completing Word

#748 Easy

Open the Lock

#752 Medium

Partition Labels

#763 Medium

Reorganize String

#767 Medium

Basic Calculator IV

#770 Hard

Jewels and Stones

#771 Easy

Rabbits in Forest

#781 Medium

Custom Sort String

#791 Medium

Number of Matching Subsequences

#792 Medium

Unique Morse Code Words

#804 Easy

Subdomain Visit Count

#811 Medium

Bus Routes

#815 Hard

Linked List Components

#817 Medium

Most Common Word

#819 Easy

Short Encoding of Words

#820 Medium

Card Flipping Game

#822 Medium

Binary Trees With Factors

#823 Medium

Count Unique Characters of All Substrings of a Given String

#828 Hard

Find And Replace in String

#833 Medium

Similar String Groups

#839 Hard

Magic Squares In Grid

#840 Medium

Hand of Straights

#846 Medium

Buddy Strings

#859 Easy

All Nodes Distance K in Binary Tree

#863 Medium

Smallest Subtree with all the Deepest Nodes

#865 Medium

Reordered Power of 2

#869 Medium

Length of Longest Fibonacci Subsequence

#873 Medium

Walking Robot Simulation

#874 Medium

Uncommon Words from Two Sentences

#884 Easy

Fair Candy Swap

#888 Easy

Construct Binary Tree from Preorder and Postorder Traversal

#889 Medium

Find and Replace Pattern

#890 Medium

Groups of Special-Equivalent Strings

#893 Medium

Maximum Frequency Stack

#895 Hard

Fruit Into Baskets

#904 Medium

Online Election

#911 Medium

X of a Kind in a Deck of Cards

#914 Medium

Word Subsets

#916 Medium

3Sum With Multiplicity

#923 Medium

Minimize Malware Spread

#924 Hard

Minimize Malware Spread II

#928 Hard

Unique Email Addresses

#929 Easy

Binary Subarrays With Sum

#930 Medium

Minimum Area Rectangle

#939 Medium

Most Stones Removed with Same Row or Column

#947 Medium

Largest Component Size by Common Factor

#952 Hard

Verifying an Alien Dictionary

#953 Easy

Array of Doubled Pairs

#954 Medium

Prison Cells After N Days

#957 Medium

Regions Cut By Slashes

#959 Medium

N-Repeated Element in Size 2N Array

#961 Easy

Vowel Spellchecker

#966 Medium

Powerful Integers

#970 Easy

Subarray Sums Divisible by K

#974 Medium

Time Based Key-Value Store

#981 Medium

Triples with Bitwise AND Equal To Zero

#982 Hard

Vertical Order Traversal of a Binary Tree

#987 Hard

Subarrays with K Different Integers

#992 Hard

Number of Squareful Arrays

#996 Hard

Find the Town Judge

#997 Easy

Grid Illumination

#1001 Hard

Find Common Characters

#1002 Easy

Pairs of Songs With Total Durations Divisible by 60

#1010 Medium

Smallest Integer Divisible by K

#1015 Medium

Longest Arithmetic Subsequence

#1027 Medium

Escape a Large Maze

#1036 Hard

Longest String Chain

#1048 Medium

Distant Barcodes

#1054 Medium

Flip Columns For Maximum Number of Equal Rows

#1072 Medium

Number of Submatrices That Sum to Target

#1074 Hard

Letter Tile Possibilities

#1079 Medium

Largest Values From Labels

#1090 Medium

Delete Nodes And Return Forest

#1110 Medium

Relative Sort Array

#1122 Easy

Lowest Common Ancestor of Deepest Leaves

#1123 Medium

Longest Well-Performing Interval

#1124 Medium

Number of Equivalent Domino Pairs

#1128 Easy

Alphabet Board Path

#1138 Medium

Snapshot Array

#1146 Medium

Swap For Longest Repeated Character Substring

#1156 Medium

Find Words That Can Be Formed by Characters

#1160 Easy

Invalid Transactions

#1169 Medium

Compare Strings by Frequency of the Smallest Character

#1170 Medium

Remove Zero Sum Consecutive Nodes from Linked List

#1171 Medium

Dinner Plate Stacks

#1172 Hard

Can Make Palindrome from Substring

#1177 Medium

Number of Valid Words for Each Puzzle

#1178 Hard

Maximum Number of Balloons

#1189 Easy

Smallest String With Swaps

#1202 Medium

Unique Number of Occurrences

#1207 Easy

Longest Arithmetic Subsequence of Given Difference

#1218 Medium

Maximum Equal Frequency

#1224 Hard

Count Number of Nice Subarrays

#1248 Medium

Find Elements in a Contaminated Binary Tree

#1261 Medium

Find Winner on a Tic Tac Toe Game

#1275 Easy

Group the People Given the Group Size They Belong To

#1282 Medium

Minimum Number of Flips to Convert Binary Matrix to Zero Matrix

#1284 Hard

Divide Array in Sets of K Consecutive Numbers

#1296 Medium

Maximum Number of Occurrences of a Substring

#1297 Medium

Get Watched Videos by Your Friends

#1311 Medium

Rank Transform of an Array

#1331 Easy

Reduce Array Size to The Half

#1338 Medium

Jump Game IV

#1345 Hard

Check If N and Its Double Exist

#1346 Easy

Minimum Number of Steps to Make Two Strings Anagram

#1347 Medium

Tweet Counts Per Frequency

#1348 Medium

Apply Discount Every n Orders

#1357 Medium

Number of Substrings Containing All Three Characters

#1358 Medium

How Many Numbers Are Smaller Than the Current Number

#1365 Easy

Rank Teams by Votes

#1366 Medium

Increasing Decreasing String

#1370 Easy

Find the Longest Substring Containing Vowels in Even Counts

#1371 Medium

Cinema Seat Allocation

#1386 Medium

Find Lucky Integer in an Array

#1394 Easy

Design Underground System

#1396 Medium

Count Largest Group

#1399 Easy

Construct K Palindrome Strings

#1400 Medium

HTML Entity Parser

#1410 Medium

Display Table of Food Orders in a Restaurant

#1418 Medium

Destination City

#1436 Easy

Count Triplets That Can Form Two Arrays of Equal XOR

#1442 Medium

Minimum Time to Collect All Apples in a Tree

#1443 Medium

People Whose List of Favorite Companies Is Not a Subset of Another List

#1452 Medium

Make Two Arrays Equal by Reversing Sub-arrays

#1460 Easy

Check If a String Contains All Binary Codes of Size K

#1461 Medium

Find Two Non-overlapping Sub-arrays Each With Target Sum

#1477 Medium

Least Number of Unique Integers after K Removals

#1481 Medium

Making File Names Unique

#1487 Medium

Avoid Flood in The City

#1488 Medium

Path Crossing

#1496 Easy

Check If Array Pairs Are Divisible by k

#1497 Medium

Number of Good Pairs

#1512 Easy

Number of Nodes in the Sub-Tree With the Same Label

#1519 Medium

Number of Good Ways to Split a String

#1525 Medium

Can Convert String in K Moves

#1540 Medium

Find Longest Awesome Substring

#1542 Hard

Maximum Number of Non-Overlapping Subarrays With Sum Equals Target

#1546 Medium

Find Latest Group of Size M

#1562 Medium

Number of Ways Where Square of Number Is Equal to Product of Two Numbers

#1577 Medium

Make Sum Divisible by P

#1590 Medium

Split a String Into the Max Number of Unique Substrings

#1593 Medium

Throne Inheritance

#1600 Medium

Alert Using Same Key-Card Three or More Times in a One Hour Period

#1604 Medium

Largest Substring Between Two Equal Characters

#1624 Easy

Arithmetic Subarrays

#1630 Medium

Sort Array by Increasing Frequency

#1636 Easy

Count Substrings That Differ by One Character

#1638 Medium

Check Array Formation Through Concatenation

#1640 Easy

Minimum Deletions to Make Character Frequencies Unique

#1647 Medium

Determine if Two Strings Are Close

#1657 Medium

Max Number of K-Sum Pairs

#1679 Medium

Tuple with Same Product

#1726 Medium

Sum of Unique Elements

#1748 Easy

Check if One String Swap Can Make Strings Equal

#1790 Easy

Finding the Users Active Minutes

#1817 Medium

Check if the Sentence Is Pangram

#1832 Easy

Unique Length-3 Palindromic Subsequences

#1930 Medium

Maximum Number of Words You Can Type

#1935 Easy

Find Unique Binary String

#1980 Medium

Kth Distinct String in an Array

#2053 Medium

Count Common Words With One Occurrence

#2085 Easy

Find Subsequence of Length K With the Largest Sum

#2099 Medium

Find All Possible Recipes from Given Supplies

#2115 Medium

Keep Multiplying Found Values by Two

#2154 Easy

Divide Array Into Equal Pairs

#2206 Easy

Find the Difference of Two Arrays

#2215 Easy

Minimum Rounds to Complete All Tasks

#2244 Medium

Smallest Number in Infinite Set

#2336 Medium

Max Sum of a Pair With Equal Sum of Digits

#2342 Medium

Design a Number Container System

#2349 Medium

Equal Row and Column Pairs

#2352 Medium

Count Number of Bad Pairs

#2364 Medium

Count the Number of Good Subarrays

#2537 Medium

Merge Two 2D Arrays by Summing Values

#2570 Easy

Find the Prefix Common Array of Two Arrays

#2657 Medium

First Completely Painted Row or Column

#2661 Medium

Minimum Index of a Valid Split

#2780 Medium

Count Complete Subarrays in an Array

#2799 Medium

Find Missing and Repeated Values

#2965 Easy

Find the Number of Distinct Colors Among the Balls

#3160 Medium

Minimum Length of String After Operations

#3223 Medium

Find the Count of Good Integers

#3272 Hard

Count of Substrings Containing Every Vowel and K Consonants II

#3306 Medium

Minimum Operations to Make Array Values Equal to K

#3375 Easy

Minimum Number of Operations to Make Elements in Array Distinct

#3396 Easy