上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 114 下一页
摘要: 1 class Solution: 2 def createTargetArray(self, nums: List[int], index: List[int]) -> List[int]: 3 n = len(nums) 4 result = [] 5 for i in range(n): 6 阅读全文
posted @ 2020-03-22 12:35 Sempron2800+ 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def findTheDistanceValue(self, arr1: List[int], arr2: List[int], d: int) -> int: 3 n1,n2 = len(arr1),len(arr2) 4 result = 0 5 for 阅读全文
posted @ 2020-03-22 12:34 Sempron2800+ 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def __init__(self): 3 self.result = TreeNode(-1) 4 5 def preOrder(self,node,target): 6 if node != None: 7 if node.val == target.va 阅读全文
posted @ 2020-03-21 19:23 Sempron2800+ 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1 class CustomStack: 2 def __init__(self, maxSize: int): 3 self.maxSize = maxSize 4 self.stack = [0] * maxSize 5 self.position = -1 6 7 def push(self, 阅读全文
posted @ 2020-03-21 19:10 Sempron2800+ 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 int maxpath = 0; 3 HashMap<TreeNode, Integer> map1 = new HashMap<TreeNode, Integer>(); 4 HashMap<TreeNode, Integer> map2 = new Ha 阅读全文
posted @ 2020-03-21 18:03 Sempron2800+ 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public int findTheLongestSubstring(String s) { 3 int n = s.length(); 4 Map<Character, Integer> map = new HashMap<>(); 5 map.put(' 阅读全文
posted @ 2020-03-19 09:50 Sempron2800+ 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 1 import sys 2 class Solution: 3 def luckyNumbers (self, matrix: List[List[int]]) -> List[int]: 4 m = len(matrix) 5 n = len(matrix[0]) 6 luckyset = se 阅读全文
posted @ 2020-03-15 12:54 Sempron2800+ 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def numTimesAllBlue(self, light: 'List[int]') -> int: 3 right,res = 0,0 4 for i, a in enumerate(light, start=1): 5 right = max(rig 阅读全文
posted @ 2020-03-08 13:10 Sempron2800+ 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def generateTheString(self, n: int) -> str: 3 if n == 1: 4 return 'a' 5 elif n == '2': 6 return 'ab' 7 else: 8 if n % 2 == 0: 9 re 阅读全文
posted @ 2020-03-08 13:08 Sempron2800+ 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution: 2 def sortString(self, s: str) -> str: 3 n = len(s) 4 dic = {} 5 for i in range(n): 6 if s[i] not in dic: 7 dic[s[i]] = 1 8 else: 9 阅读全文
posted @ 2020-03-08 03:31 Sempron2800+ 阅读(161) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 114 下一页