leetcode535. Encode and Decode TinyURL

2020-01-30
阅读 2 分钟
3k
TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk.

leetcode523. Continuous Subarray Sum

2019-12-31
阅读 3 分钟
1.9k
Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to a multiple of k, that is, sums up to n*k where n is also an integer.

leetcode508. Most Frequent Subtree Sum

2019-11-14
阅读 2 分钟
1.6k
Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself). So what is the most frequent subtree sum value? If there is a tie, return al...

leetcode352. Data Stream as Disjoint Intervals

2019-10-12
阅读 4 分钟
1.9k
这里面提到了一个disjoint interval的概念,它是指不相交的区间。如果新来的数据与当前的区间集产生了重合,则需要将当前的区间集进行合并。从而确保每次得到的数据集都是不相交的。

leetcode138. Copy List with Random Pointer

2017-09-16
阅读 3 分钟
1.8k
假设存在这样一个链表,在链表的每一个节点中,除了记录了自身值和指向下一个节点的指针,还有一个随机指针指向链表中任意一个节点。现在要求深度复制这份链表,在不改变原链表内容的情况下,创建一组新的对象,该组对象中的值和原链表中的值相同。