[LeetCode] Find a Safe Walk Through a Grid

3286. Find a Safe Walk Through a Grid

You are given an m x n binary matrix grid and an integer health.

You start on the upper-left corner (0, 0) and would like to get to the lower-right corner (m - 1, n - 1).

You can move up, down, left, or right from one cell to another adjacent cell as long as your health remains positive.

Cells (i, j) with grid[i][j] = 1 are considered unsafe and reduce your health by 1.

Return true if you can reach the final cell with a health value of 1 or more, and false otherwise.

Read more
[LeetCode] Find Indices of Stable Mountains

3285. Find Indices of Stable Mountains

There are n mountains in a row, and each mountain has a height. You are given an integer array height where height[i] represents the height of mountain i, and an integer threshold.

A mountain is called stable if the mountain just before it (if it exists) has a height strictly greater than threshold. Note that mountain 0 is not stable.

Return an array containing the indices of all stable mountains in any order.

Read more
[Codeforces] Global Round 26 C1. Magnitude (Easy Version)Read more
[Codeforces] Global Round 26 C2. Magnitude (Hard Version)Read more
[Codeforces] Round 956 (Div. 2) and ByteRace 2024 D. Swap DilemmaRead more
[Codeforces] Round 955 (Div. 2, with prizes from NEAR!) D. Beauty of the mountainsRead more
[Codeforces] Round 949 (Div. 2) C. Turtle and an Incomplete SequenceRead more
[LeetCode] Count the Number of Consistent Strings

1684. Count the Number of Consistent Strings

You are given a string allowed consisting of distinct characters and an array of strings words. A string is consistent if all characters in the string appear in the string allowed.

Return the number of consistent strings in the array words.

Read more
[Codeforces] Round 950 (Div. 3) F1. Field Division (easy version)Read more
[Codeforces] Round 950 (Div. 3) E. Permutation of Rows and ColumnsRead more