porcupine28
porcupine28
全部文章
分类
题解(12)
归档
标签
去牛客网
登录
/
注册
porcupine28的博客
全部文章
(共12篇)
题解 | #合并两个有序的数组#
# # # @param A int整型一维数组 # @param B int整型一维数组 # @return void # class Solution: def merge(self , A, m, B, n): # write code here ...
Python3
2021-09-27
1
442
题解 | #链表中倒数最后k个结点#
# class ListNode: # def __init__(self, x): # self.val = x # self.next = None # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @para...
Python3
2021-09-27
0
285
题解 | #统计字符#
import re while(True): try: a = input().strip() c = 0 s = 0 d = 0 o = 0 for i in a: if...
Python3
2021-09-15
0
304
题解 | #矩阵的最小路径和#
# # # @param matrix int整型二维数组 the matrix # @return int整型 # class Solution: def minPathSum(self , matrix ): # write code here m = ...
2021-09-10
0
215
题解 | #合并区间#
class Solution: def merge(self , intervals ): # write code here intervals.sort(key=lambda x:x.start) merge = [] f...
2021-09-05
0
210
题解 | #岛屿数量#
class Solution: def solve(self , grid ): # write code here row_l = len(grid) col_l = len(grid[0]) count = 0 ...
2021-08-29
0
297
题解 | #判断一个链表是否为回文结构#
class Solution: def isPail(self , head ): # write code here slow, fast = head, head rev = ListNode(None) while fa...
2021-08-28
0
306
题解 | #数组中出现次数超过一半的数字#
class Solution: def solve(self , a): # write code here i = 0 while (i<len(a)): if a[i] != i: ...
2021-08-24
0
239
题解 | #按之字形顺序打印二叉树#
# -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None cl...
2021-08-06
0
331
题解 | #括号序列#
class Solution: def isValid(self , s ): # write code here stack = [] match = {'(':')', '[':']','{':'}'} for i in s...
2021-08-05
0
200
首页
上一页
1
2
下一页
末页