All Posts

Leetcode 1380: Lucky Numbers in a Matrix

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.

Leetcode 1381: Design a Stack With Increment Operation

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.

Leetcode 1386: Cinema Seat Allocation

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.

Leetcode 1389: Create Target Array in the Given Order

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.

Leetcode 1390: Four Divisors

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.

Leetcode 1391: Check if There is a Valid Path in a Grid

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.