All Posts

Leetcode 1906: Minimum Absolute Difference Queries

Given an array of integers nums and a list of queries, where each query is defined as a subarray nums[li...ri], compute the minimum absolute difference between any two distinct elements in that subarray. If all elements in the subarray are the same, return -1.

Leetcode 1915: Number of Wonderful Substrings

A string is considered wonderful if at most one letter appears an odd number of times. Given a string word consisting of the first ten lowercase English letters (‘a’ through ‘j’), return the total number of wonderful non-empty substrings in the string word. If the same substring appears multiple times, each occurrence should be counted separately.

Leetcode 1930: Unique Length-3 Palindromic Subsequences

You are given a string s, and you need to return the number of unique palindromic subsequences of length 3 that are subsequences of s.

Leetcode 1935: Maximum Number of Words You Can Type

You are given a string ’text’ consisting of words separated by a single space and a string ‘brokenLetters’ containing the broken keys on a malfunctioning keyboard. Return the number of words in ’text’ that can be fully typed using the working keys.

Leetcode 1941: Check if All Characters Have Equal Number of Occurrences

Given a string s, determine if it is a ‘good’ string. A string is considered good if every character in it appears the same number of times.

Leetcode 1942: The Number of the Smallest Unoccupied Chair

In a party, there are n friends with distinct arrival and departure times. Each friend chooses the smallest available chair. The task is to determine the chair number where the friend numbered targetFriend will sit.