主页

12. Integer to Roman

Promble link: https://leetcode.com/problems/integer-to-roman/description/ Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numera...

阅读更多

我来筑波这一年

看看时间,不知不觉我从金泽到筑波也有一年的时间了。 这也意味着,我的博士入学也有一年的时间了。 这一年,真的也算是发生了很多事情。 我也终于对一些事情有了更深入的思考,爱情,社交关系,以及未来的发展方向等。 说来惭愧,之前的我也是过一天算一天,并没有有过太长久的规划。 总觉得,路应该走一步看一步,并没有想太多。 但现在看来,我已经年近30,也该有一些这方面的思考了。 不过想清了很多事情。之前的自己还是太天真了,对事情的思考太肤浅了。 认识到自己的能力上限,以及作为一个普通人来说,未来的发展真的受到时代的变化所影响。 同时也认识到选择大于努力这件事情,有的时候选择真的是一个很重要的课题,无关努力。 也重新对自己进行了思考,结合实际上来说。 确实没什么特别突出的地方,或者说在人群中...

阅读更多

collections

collections 实现了特定目标的容器,以提供内建容器dict,list,set和tuple的代替选择。 link: https://docs.python.org/zh-cn/3.10/library/collections.html?highlight=collections#module-collections deque deque class collections.deque([iterable[, maxlen]]) 返回一个新的双向队列对象,从左到右初始化,从iterable数据创建。 如果iterable没有指定,新队列为空。 Deque支持线程安全,内存高效添加(append)和弹出(pop),从两端都可以。 方法

阅读更多

14. Longest Common Prefix

Promble link: https://leetcode.com/problems/longest-common-prefix/description/ Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Input: strs = ["flower","flow","flight"] Output: "fl" Input: strs = ["dog","racecar","car"] Output: "" Explanation: Th...

阅读更多

13. Roman to Integer

Promble link: https://leetcode.com/problems/roman-to-integer/description/ Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, 2 is written as II in Roman numeral, just two ones added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II. Rom...

阅读更多

107. Binary Tree Level Order Traversal II

Promble link: https://leetcode.com/problems/binary-tree-level-order-traversal-ii/description/ Given the root of a binary tree, return the bottom-up level order traversal of its nodes’ values. (i.e., from left to right, level by level from leaf to root). Input: root = [3,9,20,null,null,15,7] Output: [[15,7],[9,20],[3]] Input: root = [1] Outp...

阅读更多

696. Count Binary Substrings

Promble link: https://leetcode.com/problems/count-binary-substrings/description/ Given a binary string s, return the number of non-empty substrings that have the same number of 0’s and 1’s, and all the 0’s and all the 1’s in these substrings are grouped consecutively. Substrings that occur multiple times are counted the number of times they o...

阅读更多

47. Permutations II

Promble link: https://leetcode.com/problems/permutations-ii/description/ Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. Input: nums = [1,1,2] Output: [[1,1,2], [1,2,1], [2,1,1]] Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] Appro...

阅读更多