All Posts

Leetcode 2284: Sender With Largest Word Count

You are given two arrays: one containing a series of messages, and another with the names of the senders corresponding to each message. A message is a list of words separated by spaces. Your task is to determine which sender has sent the most words across all their messages. If there is a tie for the most words, return the sender with the lexicographically larger name.

Leetcode 2287: Rearrange Characters to Make Target String

You are given two strings, s and target. Your task is to determine the maximum number of times you can rearrange the characters of s to form the string target. A character from s can only be used once in the target string, and the letters must be rearranged to form a new target string each time.

Leetcode 2288: Apply Discount to Prices

You are given a sentence, which contains words that may include prices represented by a dollar sign (’$’) followed by a sequence of digits. For each word in the sentence that represents a price, apply a given discount percentage and update the word. The price should be updated with exactly two decimal places. The goal is to return a modified sentence where the updated prices reflect the discount.

Leetcode 2299: Strong Password Checker II

A strong password is defined by the following criteria:

  1. It must contain at least 8 characters.
  2. It must have at least one lowercase letter.
  3. It must have at least one uppercase letter.
  4. It must have at least one digit.
  5. It must have at least one special character from the set: ‘!@#$%^&*()-+’.
  6. It cannot contain two consecutive identical characters. Given a string password, return true if the password satisfies all these conditions. Otherwise, return false.

Leetcode 2309: Greatest English Letter in Upper and Lower Case

Given a string s consisting of both uppercase and lowercase English letters, return the greatest letter that appears as both a lowercase and uppercase letter in the string. The returned letter should be in uppercase. If no such letter exists, return an empty string.

Leetcode 2311: Longest Binary Subsequence Less Than or Equal to K

You are given a binary string s and a positive integer k. Your task is to find the length of the longest subsequence of s that represents a binary number less than or equal to k when converted to decimal.