All Posts

Leetcode 676: Implement Magic Dictionary

Design a data structure that supports searching for words that can be matched by changing exactly one character.

Leetcode 677: Map Sum Pairs

Design a map-like data structure that supports key-value insertion and sum queries for keys starting with a specific prefix.

Leetcode 692: Top K Frequent Words

Given a list of words and an integer k, return the k most frequent words in the list. The words should be sorted by their frequency in descending order. If two words have the same frequency, they should be sorted lexicographically.

Leetcode 720: Longest Word in Dictionary

Given an array of strings words, return the longest word in the list that can be built progressively one character at a time by other words in the list.

Leetcode 792: Number of Matching Subsequences

You are given a string s and an array of strings words. Your task is to determine how many words from the array are subsequences of the string s. A subsequence of a string is derived by deleting some or no characters from the original string without altering the order of the remaining characters.

Leetcode 820: Short Encoding of Words

Given an array of words, you are to return the length of the shortest reference string that can encode these words. The reference string consists of the words concatenated with a ‘#’ character at the end, and indices are used to encode the words by identifying their position in the reference string. Each word is encoded by the substring in the reference string that starts at its position and ends at the next ‘#’.