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:
- It must contain at least 8 characters.
- It must have at least one lowercase letter.
- It must have at least one uppercase letter.
- It must have at least one digit.
- It must have at least one special character from the set: ‘!@#$%^&*()-+’.
- It cannot contain two consecutive identical characters.
Given a string
password, returntrueif the password satisfies all these conditions. Otherwise, returnfalse.