All Posts
Leetcode 809: Expressive Words
You are given a string s and a list of query words. Each word in the query list is said to be ‘stretchy’ if it can be transformed into string s by extending groups of adjacent letters. You can extend a group of letters (e.g., ‘a’, ‘bb’, ‘ccc’) as long as its length is at least 3. For example, if s = ‘heeellooo’, you could extend ’e’ and ‘o’ to make ‘hello’ stretchy. Return the number of query strings that can be stretched to become s.
Leetcode 825: Friends Of Appropriate Ages
You are given an integer array ages
, where each element represents the age of a person on a social media platform. A person will not send a friend request to another person if any of the following conditions are true:
- The recipient’s age is less than or equal to half of the sender’s age plus 7.
- The recipient’s age is greater than the sender’s age.
- The recipient’s age is greater than 100 and the sender’s age is less than 100.
Otherwise, the sender can send a friend request. Return the total number of friend requests made between people.