import osdef func(path): if os.path.isfile(path): if path.endswith(".py"): os.system("python %s" % path) elif os.path.isdir(path): list_num = os.listd ...
分类:
其他好文 时间:
2020-02-03 12:05:40
阅读次数:
61
用了前缀集合,高级的可以用前缀树 class Solution: def findWords(self, board: List[List[str]], words: List[str]) -> List[str]: if len(board) == 0 or len(board[0]) == 0: ...
分类:
其他好文 时间:
2020-02-03 09:45:19
阅读次数:
90
唉,又是掉分的一场比赛... A. 2048 Game 题意:给出一个数组,问能不能通过一系列操作(将数组中的两个数相加变成另一个数),使得数组中包含2048,数组中的数全是2的指数,可以则输出YES 思路:只要有两个数比2048小且一样,则合并,直至不存在两个数一样且比2048小,之后看看数组中是 ...
分类:
其他好文 时间:
2020-02-02 23:20:29
阅读次数:
74
一、快慢指针: leedcode 142. 环形链表 II 快慢指针的思想是设置慢指针slow和快指针fast,slow每次走一步,fast每次走两步,如果有环fast指针和slow指针必然相遇,相遇时 定义新的指针p从head开始和slow从当前位置起每次都走一步,直到相遇,相遇的位置就是环的入口 ...
分类:
编程语言 时间:
2020-02-02 22:02:24
阅读次数:
127
这里结合任哲的书籍+源代码来分析信号量1、在任哲的书中,提到信号量只有普通的信号量,没有区分freertos所谓的二值信号量和计数信号量。可以看看源代码,ucos的代码风格是很不错的,个人认为这个风格比freertos好,看起来很舒服,不像freertos一大堆宏定义。可以看到,OSSemCreat ...
分类:
其他好文 时间:
2020-02-02 16:01:14
阅读次数:
111
题目内容 You are given two non empty linked lists representing two non negative integers. The most significant digit comes first and each of their nodes c ...
分类:
其他好文 时间:
2020-02-02 15:26:42
阅读次数:
87
面向对象封装案例 II 目标 士兵突击案例 身份运算符 封装 封装 是面向对象编程的一大特点 面向对象编程的 第一步 —— 将 属性 和 方法 封装 到一个抽象的 类 中 外界 使用 类 创建 对象,然后 让对象调用方法 对象方法的细节 都被 封装 在 类的内部 一个对象的 属性 可以是 另外一个类 ...
分类:
其他好文 时间:
2020-02-02 13:34:35
阅读次数:
77
82. Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from ...
分类:
其他好文 时间:
2020-02-02 12:06:41
阅读次数:
68
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; const int N=10010<<1; struct node { int l,r,ans; } q[N]; int a[N],fa[N],d ...
分类:
其他好文 时间:
2020-02-01 21:18:27
阅读次数:
74