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 2055: Plates Between Candles

You are tasked with processing a string of plates (’*’) and candles (’|’) arranged on a table. For a set of queries, you must determine the number of plates that are enclosed by candles within specified substrings of the string.

Leetcode 2063: Vowels of All Substrings

You are given a string word consisting of lowercase English letters. Your task is to return the total sum of the number of vowels (‘a’, ’e’, ‘i’, ‘o’, and ‘u’) present in every possible substring of word. A substring is any contiguous sequence of characters in the word.

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 2075: Decode the Slanted Ciphertext

Given an encoded string and the number of rows used to encode the original text, recover the original string. The encoded text is produced by filling a matrix in a slanted transposition cipher and reading it row by row.

Leetcode 2086: Minimum Number of Food Buckets to Feed the Hamsters

You are given a string representing hamster positions. The string consists of ‘H’ for a hamster and ‘.’ for an empty space. You must place food buckets in empty positions such that all hamsters are fed. A hamster is fed if a food bucket is placed at one of its adjacent positions. Your task is to return the minimum number of food buckets required to feed all the hamsters. If it is impossible, return -1.