You are given a matrix of distinct numbers with dimensions m x n. A lucky number in the matrix is an element that is the minimum value in its row and the maximum value in its column. Your task is to find and return all such lucky numbers.
Design a stack that supports increment operations on its elements. Implement the CustomStack class, which supports adding elements, popping the top element, and incrementing the bottom k elements.
A cinema has multiple rows, each with ten seats arranged in a line. Some seats are already reserved. You need to determine the maximum number of four-person groups that can be seated in the available seats. A four-person group requires four adjacent seats in one row. If an aisle splits a group in the middle, they can still be seated if there are two consecutive seats on both sides of the aisle.
Given two arrays of integers nums and index, the task is to create a target array by inserting elements of nums at the positions specified by index. After processing all elements, return the target array.
Given an integer array nums, find the sum of divisors of all integers in that array that have exactly four divisors. If there are no such integers, return 0.
You are given an m x n grid where each cell represents a street. The streets have different connections between neighboring cells. Starting from the top-left corner of the grid, you need to find if there exists a valid path to the bottom-right corner, following the direction of the streets.