Hash-table

Level: Beginner

1. Design a Hash Map: Implement a basic hash map (dictionary) with operations like put, get, and remove.
2. Design a Hash Set: Implement a basic hash set with operations like add, remove, and contains.
3. Two Sum: Write a function to find two numbers in an array that add up to a specific target using a hash table.
4. Group Anagrams: Implement a function to group anagrams from a list of strings using a hash table.
5. Intersection of Two Arrays: Write a function to find the intersection of two arrays using a hash table.
6. Find Duplicate: Implement a function to find a duplicate number in an array using a hash table.
7. First Unique Character in a String: Write a function to find the first non-repeating character in a string using a hash table.
8. Valid Anagram: Implement a function to check if two strings are anagrams using a hash table.
9. Jewels and Stones: Write a function to count how many stones are jewels using a hash table.
10. Find All Duplicates in an Array: Implement a function to find all duplicates in an array using a hash table.
11. Top K Frequent Elements: Write a function to find the k most frequent elements in an array using a hash table.
12. Contains Duplicate: Implement a function to check if an array contains any duplicates using a hash table.
13. Word Pattern: Write a function to check if a string follows a given pattern using a hash table.
14. Isomorphic Strings: Implement a function to determine if two strings are isomorphic using a hash table.
15. Subdomain Visit Count: Write a function to count the number of visits for each subdomain using a hash table.
16. Find Common Characters: Implement a function to find common characters in an array of strings using a hash table.
17. Valid Sudoku: Write a function to determine if a 9x9 Sudoku board is valid using a hash table.
18. Happy Number: Implement a function to determine if a number is happy using a hash table.
19. Uncommon Words from Two Sentences: Write a function to find all uncommon words from two sentences using a hash table.
20. Find the Difference: Implement a function to find the difference between two strings using a hash table.
21. Longest Palindrome: Write a function to find the length of the longest palindrome that can be built with the given characters using a hash table.
22. Intersection of Two Arrays II: Implement a function to find the intersection of two arrays II using a hash table.
23. Keyboard Row: Write a function to find words that can be typed using letters of only one row on a keyboard using a hash table.
24. Contains Duplicate II: Implement a function to check if an array contains any duplicates within k distance using a hash table.
25. Majority Element: Write a function to find the majority element in an array using a hash table.
26. Ransom Note: Implement a function to check if a ransom note can be constructed from the letters in a magazine using a hash table.
27. Intersection of Multiple Arrays: Write a function to find the intersection of multiple arrays using a hash table.
28. Employee Importance: Implement a function to find the total importance value of an employee and their subordinates using a hash table.
29. Longest Harmonious Subsequence: Write a function to find the length of the longest harmonious subsequence in an array using a hash table.
30. Unique Morse Code Words: Implement a function to find the number of unique Morse code representations of words using a hash table.

Intermediate Level: View

Advanced Level: View