1876 Map Of Highest Peak
Map of Highest Peak You are given an integer matrix isWater of size m x n that represents a map of land and water cells. If isWater[i][j] == 0, cell (i, j) is a **land** cell. If isWater[i][j] =...
Map of Highest Peak You are given an integer matrix isWater of size m x n that represents a map of land and water cells. If isWater[i][j] == 0, cell (i, j) is a **land** cell. If isWater[i][j] =...
Grid Game You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix. ...
The intention of this series of writeups is to slowly implement all exercises from the book in C and/or rust. This is meant to be a fun project rather than writing production perfect code. Uni...
First Completely Painted Row or Column You are given a 0-indexed integer array arr, and an m x n integer matrix mat. arr and mat both contain all the integers in the range [1, m * n]. Go through...
Trapping Rain Water II Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining. Example 1...
Minimum Cost to Make at Least One Valid Path in a Grid Given an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign...
Neighboring Bitwise XOR A 0-indexed array derived with length n is derived by computing the bitwise XOR (⊕) of adjacent values in a binary array original of length n. Specifically, for each inde...
Bitwise XOR of All Pairings You are given two 0-indexed arrays, nums1 and nums2, consisting of non-negative integers. There exists another array, nums3, which contains the bitwise XOR of all pair...
Minimize XOR Given two positive integers num1 and num2, find the positive integer x such that: x has the same number of set bits as num2, and The value x XOR num1 is **minimal**. Note that XOR...
Find the Prefix Common Array of Two Arrays You are given two 0-indexed **integer **permutations A and B of length n. A prefix common array of A and B is an array C such that C[i] is equal to the...