You are given an m x n matrix representing a crossword puzzle. The matrix contains lowercase English letters, empty spaces (’ ‘), and blocked cells (’#’). Given a word, determine if it can be placed horizontally or vertically in the crossword while adhering to the following constraints.
You are given a 1D integer array called ‘original’ and two integers ’m’ and ’n’. Your task is to convert this 1D array into a 2D array with ’m’ rows and ’n’ columns. The elements from the ‘original’ array should be placed row-wise in the new 2D array.
You are given a 2D grid of integers, and an integer x. In each operation, you can either add x or subtract x from any element in the grid. Your task is to transform the grid into a uni-value grid, where all elements are equal. Return the minimum number of operations needed to achieve this, or return -1 if it is not possible.
You are given a 2D binary grid, where ‘1’ represents a security device and ‘0’ represents an empty cell. A laser beam can be formed between two devices if they are located on two different rows and no security device is in any row between them. The task is to find the total number of laser beams that can be formed.
You are given an n x n matrix where each element is an integer. The matrix is considered valid if every row and every column contains all the integers from 1 to n (inclusive). Your task is to check whether the given matrix satisfies this condition. Return true if the matrix is valid, and false otherwise.
You are given a 2D grid representing a shop map with walls, empty spaces, and items with prices. Your task is to find the top k highest-ranked items within a given price range. The ranking is based on distance, price, row, and column number.