All Posts

Leetcode 2482: Difference Between Ones and Zeros in Row and Column

You are given an m x n binary matrix grid. You need to create a difference matrix diff where each element diff[i][j] is calculated by summing the number of ones and subtracting the number of zeros in the respective row and column.

Leetcode 2491: Divide Players Into Teams of Equal Skill

You are given an array of integers representing the skill levels of players. You need to divide the players into pairs such that the sum of the skill levels of each pair is the same across all pairs. If it’s possible to form such pairs, return the sum of their chemistry, which is the product of the skill levels in each pair. If no such division is possible, return -1.

Leetcode 2496: Maximum Value of a String in an Array

Given an array of alphanumeric strings, you are tasked with determining the maximum value of any string in the array. The value of a string is determined in the following way: If the string consists only of digits, its value is its numeric representation in base 10. If it contains any letters, its value is the length of the string.

Leetcode 2497: Maximum Star Sum of a Graph

Given a graph with n nodes, each node having a value, and a list of edges connecting the nodes, your task is to determine the maximum star sum that can be obtained. A star graph is a subgraph where all edges are connected to a central node. The star sum is the sum of the values of the central node and the nodes connected by edges to it. You are allowed to include at most k edges in the star graph.

Leetcode 2498: Frog Jump II

A frog starts on the first stone in a river and wants to jump to the last stone and then return to the first stone. The frog can jump to any stone at most once. The cost of a jump is defined as the absolute difference between the positions of two stones. The frog must choose a path that minimizes the maximum jump length during the entire journey. Return the minimum cost of the path where the cost is defined as the maximum length of any jump.

Leetcode 2500: Delete Greatest Value in Each Row

You are given a matrix grid with positive integers. In each operation, remove the greatest value from each row, and if multiple elements have the same greatest value, remove any one of them. After removing the greatest value from all rows, add the maximum of these values to the answer. The number of columns decreases by one after each operation. Perform these operations until the grid is empty, and return the sum of the maximum values from all operations.