[LeetCode] Lonely Pixel I

531. Lonely Pixel I

Given an m x n picture consisting of black ‘B’ and white ‘W’ pixels, return the number of black lonely pixels.

A black lonely pixel is a character ‘B’ that located at a specific position where the same row and same column don’t have any other black pixels.

Read more
[AtCoder] D - Game in Momotetsu WorldRead more
[AtCoder] C - Secret NumberRead more
[AtCoder] B - RGB MatchingRead more
[AtCoder] A - 2nd Greatest DistanceRead more
[AtCoder] D - CookingRead more
[AtCoder] C - TourRead more
[LeetCode] Find Minimum Time to Finish All Jobs II

2323. Find Minimum Time to Finish All Jobs II

You are given two 0-indexed integer arrays jobs and workers of equal length, where jobs[i] is the amount of time needed to complete the ith job, and workers[j] is the amount of time the jth worker can work each day.

Each job should be assigned to exactly one worker, such that each worker completes exactly one job.

Return the minimum number of days needed to complete all the jobs after assignment.

Read more
[LeetCode] Number of Increasing Paths in a Grid

2328. Number of Increasing Paths in a Grid

You are given an m x n integer matrix grid, where you can move from a cell to any adjacent cell in all 4 directions.

Return the number of strictly increasing paths in the grid such that you can start from any cell and end at any cell. Since the answer may be very large, return it modulo 109 + 7.

Two paths are considered different if they do not have exactly the same sequence of visited cells.

Read more
[LeetCode] Number of People Aware of a Secret

2327. Number of People Aware of a Secret

On day 1, one person discovers a secret.

You are given an integer delay, which means that each person will share the secret with a new person every day, starting from delay days after discovering the secret. You are also given an integer forget, which means that each person will forget the secret forget days after discovering it. A person cannot share the secret on the same day they forgot it, or on any day afterwards.

Given an integer n, return the number of people who know the secret at the end of day n. Since the answer may be very large, return it modulo 109 + 7.

Read more