All Posts

Leetcode 2186: Minimum Number of Steps to Make Two Strings Anagram II

You are given two strings, s and t. In each step, you can append any character to either s or t. Your task is to determine the minimum number of steps required to make s and t anagrams of each other.

Leetcode 2190: Most Frequent Number Following Key In an Array

You are given an integer array ’nums’ and an integer ‘key’, which is present in ’nums’. Your task is to find the integer that most frequently appears immediately after an occurrence of ‘key’ in the array. In other words, count how many times each integer follows ‘key’ and return the integer that appears the most.

Leetcode 2225: Find Players With Zero or One Losses

You are given an array matches where each element matches[i] = [winneri, loseri] indicates that player winneri defeated player loseri in a match. Your task is to return a list answer of size 2 where:

  • answer[0] contains the list of players who have never lost a match.
  • answer[1] contains the list of players who have lost exactly one match.

The players in both lists should be sorted in increasing order.

Leetcode 2275: Largest Combination With Bitwise AND Greater Than Zero

You are given an array of positive integers candidates. Your task is to evaluate the bitwise AND of every possible combination of numbers in the array and return the size of the largest combination where the result of the AND operation is greater than 0. Each number in the array may only be used once in each combination.

Leetcode 2283: Check if Number Has Equal Digit Count and Digit Value

You are given a string num consisting of digits, where each digit represents a specific number. The task is to verify if for every index i in the string, the digit at index i appears exactly num[i] times in the entire string. Return true if the condition holds for all indices, and false otherwise.

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.