All Posts
Leetcode 2053: Kth Distinct String in an Array
Find the k-th unique string in an array based on its first occurrence. If fewer than k unique strings exist, return an empty string.
Leetcode 2068: Check Whether Two Strings are Almost Equivalent
You are given two strings, word1 and word2, each of length n. The two strings are considered almost equivalent if the difference in frequency of each letter between word1 and word2 is at most 3. Return true if they are almost equivalent, or false otherwise.
Leetcode 2080: Range Frequency Queries
Design a data structure that allows you to efficiently find the frequency of a given value in a subarray. Implement the class RangeFreqQuery with the following methods:
RangeFreqQuery(int[] arr)initializes the data structure.int query(int left, int right, int value)returns the frequency ofvaluein the subarray fromlefttoright.