Hash Function Problems
Master hash function problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 17 problems in this category.
Total Problems: 17
Easy: 4
Medium: 5
Hard: 8
Showing 17 of 17 problems
Problems
Scroll within this area to browse all problems
#
Title
Difficulty
Hash Function LeetCode Problems List
- 572. Subtree of Another Tree - Easy - Hash FunctionGiven the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and... Topics: Tree, Depth-First Search, String Matching, Binary Tree, Hash Function
- 817. Design HashMap - Easy - Hash FunctionDesign a HashMap without using any built-in hash table libraries. Implement the MyHashMap class: MyHashMap() initializes the object with an empty map.... Topics: Array, Hash Table, Linked List, Design, Hash Function
- 816. Design HashSet - Easy - Hash FunctionDesign a HashSet without using any built-in hash table libraries. Implement MyHashSet class: void add(key) Inserts the value key into the HashSet. boo... Topics: Array, Hash Table, Linked List, Design, Hash Function
- 214. Shortest Palindrome - Hard - Hash FunctionYou are given a string s. You can convert s to a palindrome by adding characters in front of it. Return the shortest palindrome you can find by perfor... Topics: String, Rolling Hash, String Matching, Hash Function
- 1508. Longest Happy Prefix - Hard - Hash FunctionA string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself). Given a string s, return the longest happy prefi... Topics: String, Rolling Hash, String Matching, Hash Function
- 535. Encode and Decode TinyURL - Medium - Hash FunctionNote: This is a companion problem to the System Design problem: Design TinyURL. TinyURL is a URL shortening service where you enter a URL such as http... Topics: Hash Table, String, Design, Hash Function
- 187. Repeated DNA Sequences - Medium - Hash FunctionThe DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'. For example, "ACGAATTCCG" is a DNA sequence. When study... Topics: Hash Table, String, Bit Manipulation, Sliding Window, Rolling Hash, Hash Function
- 718. Maximum Length of Repeated Subarray - Medium - Hash FunctionGiven two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays.... Topics: Array, Binary Search, Dynamic Programming, Sliding Window, Rolling Hash, Hash Function
- 2079. Delete Duplicate Folders in System - Hard - Hash FunctionDue to a bug, there are many duplicate folders in a file system. You are given a 2D array paths, where paths[i] is an array representing an absolute p... Topics: Array, Hash Table, String, Trie, Hash Function
- 1122. Longest Duplicate Substring - Hard - Hash FunctionGiven a string s, consider all duplicated substrings: (contiguous) substrings of s that occur 2 or more times. The occurrences may overlap. Return any... Topics: String, Binary Search, Sliding Window, Rolling Hash, Suffix Array, Hash Function
- 3303. Find Beautiful Indices in the Given Array II - Hard - Hash FunctionYou are given a 0-indexed string s, a string a, a string b, and an integer k. An index i is beautiful if: 0 <= i <= s.length - a.length s[i..(i + a.le... Topics: Two Pointers, String, Binary Search, Rolling Hash, String Matching, Hash Function
- 1557. Check If a String Contains All Binary Codes of Size K - Medium - Hash FunctionGiven a binary string s and an integer k, return true if every binary code of length k is a substring of s. Otherwise, return false.... Topics: Hash Table, String, Bit Manipulation, Rolling Hash, Hash Function
- 3309. Count Prefix and Suffix Pairs I - Easy - Hash FunctionYou are given a 0-indexed string array words. Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2: isPrefixAndSuff... Topics: Array, String, Trie, Rolling Hash, String Matching, Hash Function
- 2051. Longest Common Subpath - Hard - Hash FunctionThere is a country of n cities numbered from 0 to n - 1. In this country, there is a road connecting every pair of cities. There are m friends numbere... Topics: Array, Binary Search, Rolling Hash, Suffix Array, Hash Function
- 2275. Find Substring With Given Hash Value - Hard - Hash FunctionThe hash of a 0-indexed string s of length k, given integers p and m, is computed using the following function: hash(s, p, m) = (val(s[0]) * p0 + val(... Topics: String, Sliding Window, Rolling Hash, Hash Function
- 3269. Number of Subarrays That Match a Pattern I - Medium - Hash FunctionYou are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1. A subarra... Topics: Array, Rolling Hash, String Matching, Hash Function
- 3305. Count Prefix and Suffix Pairs II - Hard - Hash FunctionYou are given a 0-indexed string array words. Let's define a boolean function isPrefixAndSuffix that takes two strings, str1 and str2: isPrefixAndSuff... Topics: Array, String, Trie, Rolling Hash, String Matching, Hash Function
Related LeetCode Topics
- Array LeetCode Problems
- Backtracking LeetCode Problems
- Biconnected Component LeetCode Problems
- Binary Indexed Tree LeetCode Problems
- Binary Search LeetCode Problems
- Binary Search Tree LeetCode Problems
- Binary Tree LeetCode Problems
- Bit Manipulation LeetCode Problems
- Bitmask LeetCode Problems
- Brainteaser LeetCode Problems
- Breadth-First Search LeetCode Problems
- Bucket Sort LeetCode Problems
- Combinatorics LeetCode Problems
- Concurrency LeetCode Problems
- Counting LeetCode Problems
- Counting Sort LeetCode Problems
- Data Stream LeetCode Problems
- Database LeetCode Problems
- Depth-First Search LeetCode Problems
- Design LeetCode Problems