1857.largest-color-value-in-a-directed-graph.pdf
92.3 KB
leetcode.com 2023-04-09
🔴1857.largest-color-value-in-a-directed-graph
🏷️ Tags
#hash_table #dynamic_programming #graph #topological_sort #memoization #counting
🔴1857.largest-color-value-in-a-directed-graph
🏷️ Tags
#hash_table #dynamic_programming #graph #topological_sort #memoization #counting
1019.next-greater-node-in-linked-list.pdf
92.6 KB
leetcode.cn 2023-04-10
🟡1019.next-greater-node-in-linked-list
🏷️ Tags
#stack #array #linked_list #monotonic_stack
🟡1019.next-greater-node-in-linked-list
🏷️ Tags
#stack #array #linked_list #monotonic_stack
📌 Leetcode Daily Question
Features:
* Daily questions from leetcode.cn and leetcode.com
* Telegram Instant View to display the question's description
* RSS feeds for notifications
RSS-EN | RSS-CN
👨🏻💻 Author: @NavePnow
📺 Channel: @leetcodeDailyQuestion
⭐ Feel free to start the repository!
Features:
* Daily questions from leetcode.cn and leetcode.com
* Telegram Instant View to display the question's description
* RSS feeds for notifications
RSS-EN | RSS-CN
👨🏻💻 Author: @NavePnow
📺 Channel: @leetcodeDailyQuestion
⭐ Feel free to start the repository!
Leetcode Daily Question pinned «📌 Leetcode Daily Question Features: * Daily questions from leetcode.cn and leetcode.com * Telegram Instant View to display the question's description * RSS feeds for notifications RSS-EN | RSS-CN 👨🏻💻 Author: @NavePnow 📺 Channel: @leetcodeDailyQuestion…»
leetcode.cn 2023-04-12
🔴1147.longest-chunked-palindrome-decomposition
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming #hash_function #rolling_hash
🔴1147.longest-chunked-palindrome-decomposition
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming #hash_function #rolling_hash
Telegraph
longest-chunked-palindrome-decomposition
你会得到一个字符串 text 。你应该把它分成 k 个子字符串 (subtext1, subtext2,…, subtextk) ,要求满足:
leetcode.cn 2023-04-15
🟡1042.flower-planting-with-no-adjacent
🏷️ Tags
#depth_first_search #breadth_first_search #graph
🟡1042.flower-planting-with-no-adjacent
🏷️ Tags
#depth_first_search #breadth_first_search #graph
Telegraph
flower-planting-with-no-adjacent
有 n 个花园,按从 1 到 n 标记。另有数组 paths ,其中 paths[i] = [xi, yi] 描述了花园 xi 到花园 yi 的双向路径。在每个花园中,你打算种下四种花之一。 另外,所有花园 最多 有 3 条路径可以进入或离开. 你需要为每个花园选择一种花,使得通过路径相连的任何两个花园中的花的种类互不相同。 以数组形式返回 任一 可行的方案作为答案 answer,其中 answer[i] 为在第 (i+1) 个花园中种植的花的种类。花的种类用 1、2、3、4 表示。保证存在答案。 …
leetcode.com 2023-04-15
🔴2218.maximum-value-of-k-coins-from-piles
🏷️ Tags
#array #dynamic_programming #prefix_sum
🔴2218.maximum-value-of-k-coins-from-piles
🏷️ Tags
#array #dynamic_programming #prefix_sum
Telegraph
maximum-value-of-k-coins-from-piles
There are n piles of coins on a table. Each pile consists of a positive number of coins of assorted denominations. In one move, you can choose any coin on top of any pile, remove it, and add it to your wallet. Given a list piles, where piles[i] is a list…
👍1
leetcode.cn 2023-04-16
🔴1157.online-majority-element-in-subarray
🏷️ Tags
#design #binary_indexed_tree #segment_tree #array #binary_search
🔴1157.online-majority-element-in-subarray
🏷️ Tags
#design #binary_indexed_tree #segment_tree #array #binary_search
Telegraph
online-majority-element-in-subarray
设计一个数据结构,有效地找到给定子数组的 多数元素 。 子数组的 多数元素 是在子数组中出现 threshold 次数或次数以上的元素。 实现 MajorityChecker 类:
leetcode.com 2023-04-16
🔴1639.number-of-ways-to-form-a-target-string-given-a-dictionary
🏷️ Tags
#array #string #dynamic_programming
🔴1639.number-of-ways-to-form-a-target-string-given-a-dictionary
🏷️ Tags
#array #string #dynamic_programming
Telegraph
number-of-ways-to-form-a-target-string-given-a-dictionary
You are given a list of strings of the same length words and a string target. Your task is to form target using the given words under the following rules:
leetcode.cn 2023-04-18
🟡1026.maximum-difference-between-node-and-ancestor
🏷️ Tags
#tree #depth_first_search #binary_tree
🟡1026.maximum-difference-between-node-and-ancestor
🏷️ Tags
#tree #depth_first_search #binary_tree
Telegraph
maximum-difference-between-node-and-ancestor
给定二叉树的根节点 root,找出存在于 不同 节点 A 和 B 之间的最大值 V,其中 V = |A.val - B.val|,且 A 是 B 的祖先。 (如果 A 的任何子节点之一为 B,或者 A 的任何子节点是 B 的祖先,那么我们认为 A 是 B 的祖先) 示例 1: 输入:root = [8,3,10,1,6,null,14,null,null,4,7,13] 输出:7 解释: 我们有大量的节点与其祖先的差值,其中一些如下: |8 - 3| = 5 |3 - 7| = 4 |8 - 1| =…