摘要: 1. 这段时间在断断续续研究golang,尝试用它写一个server/client。涉及内容包括:Go的协程使用,特别是用于网络通信时的监听、Read、write。Go包管理模式。Go net、time等包的源码阅读,顺便一提,感觉学习go最好的方法是读源码?此外其他部分:Go基础语法Go 队列的创建及使用Go 字节类型的创建及使用,包括填充等网络通信特别需要的。Go 部分内联函数的学习使用。还需... 阅读全文
posted @ 2019-11-13 09:20 miuc 阅读(116) 评论(0) 推荐(0) 编辑
摘要: class Solution(object): def removeOuterParentheses(self, S): """ :type S: str :rtype: str """ mark = 0 ret = '' for i in S: if i == '(': ... 阅读全文
posted @ 2019-04-08 09:25 miuc 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 不是很难的模拟题,想好前后状态的变化就会发现,其实“)”括号才可以抵消之前的“(”括号,反之不行。class Solution(object): def minAddToMakeValid(self, S): """ :type S: str :rtype: int """ l, r = 0, 0 for i... 阅读全文
posted @ 2019-03-27 09:02 miuc 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 实际上感觉是带参的宽搜,但是因为懒得写。。还是强行写了深搜。这道题在lt上提交有bug,好像是因为我用了node的未声明变量?单独测试是没问题的class Solution(object): result = [] def buildNode(self, v, father, root): ret = TreeNode(v) ret.fath... 阅读全文
posted @ 2019-03-20 10:59 miuc 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 递归题# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass Solution(object): def pr... 阅读全文
posted @ 2019-03-18 09:23 miuc 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 感觉不是很难的题,控制一下变量和范围就OK了。class Solution(object): def diStringMatch(self, S): """ :type S: str :rtype: List[int] """ x1 = 10000 x2 = 10000 ret = [10000... 阅读全文
posted @ 2019-03-15 15:23 miuc 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 简单的字符串判断,水题开启新一天。class Solution(object): def findAndReplacePattern(self, words, pattern): """ :type words: List[str] :type pattern: str :rtype: List[str] """ ... 阅读全文
posted @ 2019-03-14 09:27 miuc 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 水一题弱题庆祝IBM MQ搭建成功。class Solution(object): def judgeCircle(self, moves): """ :type moves: str :rtype: bool """ result = [0, 0] for i in moves: fo... 阅读全文
posted @ 2019-03-13 15:48 miuc 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 今天暂时木有做题(一会补),主要是最近所里提到新项目可能涉及IBM MQ对接,所以今天计划是先把IBM MQ环境准备起来。之前林晨已经问了询价那边(他们用过)的情况,当没有太多的介绍,只提到了接入、license、环境之类,我感觉等外部帮忙不太靠谱,自己研究比较稳。今天早上先去查了下IBM MQ的资料,顺藤摸瓜找到https://hub.docker.com/r/ibmcom/mq/ IBM®... 阅读全文
posted @ 2019-03-13 15:33 miuc 阅读(2121) 评论(0) 推荐(1) 编辑
摘要: 树的转换,一道新题,部分递归的条件判断不是很清晰,WA了一次。# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = Noneclass... 阅读全文
posted @ 2019-03-12 13:56 miuc 阅读(116) 评论(0) 推荐(0) 编辑