Leetcode
cortey
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Leetcode 557. Reverse Words in a String III 及 Java StringBuffer 和 StringBuilder类
目录Java StringBuffer 和 StringBuilder 类Leetcode 557. Reverse Words in a String III Java StringBuffer 和 StringBuilder 类 当对字符串进行修改的时候,需要使用 StringBuffer 和 StringBuilder 类。 和 String 类不同的是,StringBuffer 和 StringBuilder 类的对象能够被多次的修改,并且不产生新的未使用对象。 StringBuilder 类在 J原创 2020-08-19 03:11:17 · 183 阅读 · 0 评论 -
Leetcode 207. Course Schedule + Python中defaultdict用法详解
ContentsPython中defaultdict用法认识defaultdict:如何使用defaultdictLeetcode 207 题目描述:拓扑排序,DFS Python中defaultdict用法 认识defaultdict: 当我使用普通的字典时,用法一般是dict={},添加元素的只需要dict[element] =value即,调用的时候也是如此,dict[element] = xxx,但前提是element字典里,如果不在字典里就会报错。 defaultdict的作用是在于,当字典里的k原创 2020-08-05 01:25:31 · 315 阅读 · 0 评论 -
【LeetCode】938. Range Sum of BST 解题报告(Python)
题目描述 Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). The binary search tree is guaranteed to have unique values. Example 1: ...原创 2019-06-11 11:08:22 · 256 阅读 · 0 评论 -
【LeetCode】279. 四平方定理
public int numSquares(int n) { while (n % 4 == 0){ n /= 4; } if ( n % 8 == 7){ return 4; } int a = 0; while ( (a *a +b*b ==n){ int b = (int) Math.pow原创 2019-07-02 22:29:06 · 153 阅读 · 0 评论
分享