All Posts

Leetcode 1672: Richest Customer Wealth

You are given a 2D list accounts, where each row represents a customer and each element within a row is the amount of money they have in a particular bank. Your task is to return the wealth of the richest customer. A customer’s wealth is the sum of all their bank accounts’ balances. The richest customer is the one with the maximum wealth.

Leetcode 1706: Where Will the Ball Fall

You have a 2-D grid representing a box, and a number of balls that will be dropped into the box. The box has diagonal boards in each cell, which can redirect the balls either left or right. Your task is to determine the path of each ball dropped from the top of the box. The ball can either fall out of the bottom, or get stuck if it hits a ‘V’ shaped pattern between two boards or is redirected into a wall.

Leetcode 1727: Largest Submatrix With Rearrangements

You are given a binary matrix with dimensions m x n consisting of 0’s and 1’s. You can rearrange the columns of the matrix in any order. The task is to find the area of the largest submatrix within the matrix where every element is 1 after optimally reordering the columns.

Leetcode 1738: Find Kth Largest XOR Coordinate Value

You are given a 2D matrix of size m x n, consisting of non-negative integers. You are also given an integer k. The value of coordinate (a, b) in the matrix is the XOR of all the values from matrix[0][0] to matrix[a][b] (inclusive), where 0 <= a < m and 0 <= b < n (0-indexed). Your task is to find the kth largest value (1-indexed) among all the XOR values of matrix coordinates.

Leetcode 1765: Map of Highest Peak

Given a 2D grid where each cell is either water (1) or land (0), assign heights to the land cells such that the height difference between adjacent cells is at most 1. The goal is to maximize the height values of land cells while ensuring the height of water cells is 0. Return the grid with assigned heights.

Leetcode 1861: Rotating the Box

You are given an m x n matrix of characters box, where each cell is a stone (#), a stationary obstacle (*), or an empty space (.). After rotating the box 90 degrees clockwise, gravity will cause stones to fall down until they land on an obstacle, another stone, or the bottom. Return the updated matrix after the stones have fallen.