Skip to main content

97 docs tagged with "Hash Table"

View all tags

4Sum II (LeetCode)

Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.

Contains Duplicate II(LeetCode)

Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k.

Contains Duplicate(LeetCode)

Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

Contiguous Array

Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1.

Design HashMap

This is a solution to the Design HashMap problem on LeetCode.

Fair Candy Swap

Find one pair of candy boxes, one from Alice and one from Bob, to swap so they both end up with the same total number of candies.

Happy Number

This document provides a solution for Happy Number problem on LeetCode.

Isomorphic Strings

This document provides solutions for determining if two strings are isomorphic.

LFU Cache

This is a solution to the LFU Cache problem on LeetCode.

Lonely Pixel I

Given an m x n picture consisting of black 'B' and white 'W' pixels, return the number of black lonely pixels.

Majority Element

Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2βŒ‹ times. You may assume that the majority element always exists in the array.

Minimum Window Substring(LeetCode)

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".

Most Frequent Subtree Sum

Given the root of a binary tree, return the most frequent subtree sum. If there is a tie, return all the values with the highest frequency in any order.

Open the Lock

This is a solution to the Open the Lock problem on LeetCode.

Replace Words

This is a solution to the Replace Words problem on LeetCode.

Sort Characters By Frequency (LeetCode)

Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.

Sort Characters By Frequency (LeetCode)

Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.

Subdomain Visit Count

Given an array of count-paired domains, return an array showing the total visit counts for each subdomain and its parent domains.

Task Scheduler

This is a solution to the Task Scheduler problem on LeetCode.

Two Out of Three

Return a distinct array containing all the values that are present in at least two out of the three arrays.

Valid Anagram

This is a solution to the Valid Anagram problem on LeetCode.

Word Break(LeetCode)

Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.

Word Subsets

This is a solution to the Word Subsets problem on LeetCode.