杨舜文
杨舜文
全部文章
分类
题解(113)
归档
标签
去牛客网
登录
/
注册
杨舜文的博客
全部文章
(共98篇)
题解 | #表达式求值#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # 返回表达式的值 # @param s string字符串 待计算的表达式 # @return int整型 # class Solution: def solve(self , s ): # ...
2021-08-18
0
312
题解 | #字符串分隔#
while(True): try: s = input() except EOFError: break size = len(s) while (size >= 8): print(s[:8]) ...
2021-08-17
0
294
题解 | #二叉树根节点到叶子节点和为指定值的路径#
# class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # # @param root TreeN...
2021-08-17
0
349
题解 | #最长回文子串#
# -*- coding:utf-8 -*- class Solution: def getLongestPalindrome(self, A, n): # write code here ret = 1 size = len(A) - 1 ...
2021-08-15
0
281
题解 | #反转字符串#
# # 反转字符串 # @param str string字符串 # @return string字符串 # class Solution: def solve(self , str ): # write code here return str[::-1]
2021-08-15
0
263
题解 | #子数组的最大累加和问题#
# # max sum of the subarray # @param arr int整型一维数组 the array # @return int整型 # class Solution: def maxsumofSubarray(self , arr ): # write ...
2021-08-15
0
275
题解 | #寻找第K大#
# -*- coding:utf-8 -*- class Solution: def findKth(self, a, n, K): # write code here a.sort(reverse=True) return a[K-1]
2021-08-15
0
293
题解 | #实现二叉树先序,中序和后序遍历#
# class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # # @param root TreeN...
2021-08-15
0
282
题解 | #合并两个有序的数组#
# # # @param A int整型一维数组 # @param B int整型一维数组 # @return void # class Solution: def merge(self , A, m, B, n): # write code here ...
2021-08-15
0
318
题解 | #在二叉树中找到两个节点的最近公共祖先#
# class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # # @param root TreeN...
2021-08-15
0
285
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页