Merge pull request #2802 from Kristy-an/master

fix python block code highlight problem
This commit is contained in:
程序员Carl
2024-11-28 09:16:11 +08:00
committed by GitHub
3 changed files with 4 additions and 3 deletions

View File

@ -185,7 +185,7 @@ class Solution:
> 版本二:针对版本一的优化
```python3
```python
class Solution:
def nextGreaterElements(self, nums: List[int]) -> List[int]:
res = [-1] * len(nums)

View File

@ -254,6 +254,7 @@ directions = [[0, 1], [1, 0], [0, -1], [-1, 0]]
def bfs(grid, visited, x, y):
que = deque([])
que.append([x,y])
visited[x][y] = True
while que:
cur_x, cur_y = que.popleft()
for i, j in directions:

View File

@ -261,10 +261,10 @@ public class Main {
from collections import deque
# 处理输入
n, m = list(map(int, input().strip()))
n, m = list(map(int, input().split()))
g = []
for _ in range(n):
row = list(map(int, input().strip()))
row = list(map(int, input().split()))
g.append(row)
# 定义四个方向、孤岛面积(遍历完边缘后会被重置)