leetcode.cn 2023-10-11
🟡2512.reward-top-k-students
🏷️ Tags
#array #hash_table #string #sorting #heap_priority_queue
🟡2512.reward-top-k-students
🏷️ Tags
#array #hash_table #string #sorting #heap_priority_queue
Telegraph
reward-top-k-students
给你两个字符串数组 positive_feedback 和 negative_feedback ,分别包含表示正面的和负面的词汇。不会 有单词同时是正面的和负面的。 一开始,每位学生分数为 0 。每个正面的单词会给学生的分数 加 3 分,每个负面的词会给学生的分数 减 1 分。 给你 n 个学生的评语,用一个下标从 0 开始的字符串数组 report 和一个下标从 0 开始的整数数组 student_id 表示,其中 student_id[i] 表示这名学生的 ID ,这名学生的评语是 report[i] 。每名学生的…
leetcode.com 2023-10-11
🔴2251.number-of-flowers-in-full-bloom
🏷️ Tags
#array #hash_table #binary_search #ordered_set #prefix_sum #sorting
🔴2251.number-of-flowers-in-full-bloom
🏷️ Tags
#array #hash_table #binary_search #ordered_set #prefix_sum #sorting
Telegraph
number-of-flowers-in-full-bloom
You are given a 0-indexed 2D integer array flowers, where flowers[i] = [starti, endi] means the ith flower will be in full bloom from starti to endi (inclusive). You are also given a 0-indexed integer array people of size n, where people[i] is the time that…
leetcode.cn 2023-10-12
🟢2562.find-the-array-concatenation-value
🏷️ Tags
#array #two_pointers #simulation
🟢2562.find-the-array-concatenation-value
🏷️ Tags
#array #two_pointers #simulation
Telegraph
find-the-array-concatenation-value
给你一个下标从 0 开始的整数数组 nums 。 现定义两个数字的 串联 是由这两个数值串联起来形成的新数字。
leetcode.com 2023-10-15
🔴1269.number-of-ways-to-stay-in-the-same-place-after-some-steps
🏷️ Tags
#dynamic_programming
🔴1269.number-of-ways-to-stay-in-the-same-place-after-some-steps
🏷️ Tags
#dynamic_programming
Telegraph
number-of-ways-to-stay-in-the-same-place-after-some-steps
You have a pointer at index 0 in an array of size arrLen. At each step, you can move 1 position to the left, 1 position to the right in the array, or stay in the same place (The pointer should not be placed outside the array at any time). Given two integers…
leetcode.com 2023-10-17
🟡1361.validate-binary-tree-nodes
🏷️ Tags
#tree #depth_first_search #breadth_first_search #union_find #graph #binary_tree
🟡1361.validate-binary-tree-nodes
🏷️ Tags
#tree #depth_first_search #breadth_first_search #union_find #graph #binary_tree
Telegraph
validate-binary-tree-nodes
You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i], return true if and only if all the given nodes form exactly one valid binary tree. If node i has no left child then leftChild[i] will equal…
leetcode.cn 2023-10-18
🟡2530.maximal-score-after-applying-k-operations
🏷️ Tags
#greedy #array #heap_priority_queue
🟡2530.maximal-score-after-applying-k-operations
🏷️ Tags
#greedy #array #heap_priority_queue
Telegraph
maximal-score-after-applying-k-operations
给你一个下标从 0 开始的整数数组 nums 和一个整数 k 。你的 起始分数 为 0 。 在一步 操作 中:
leetcode.com 2023-10-18
🔴2050.parallel-courses-iii
🏷️ Tags
#graph #topological_sort #array #dynamic_programming
🔴2050.parallel-courses-iii
🏷️ Tags
#graph #topological_sort #array #dynamic_programming
Telegraph
parallel-courses-iii
You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given a 2D integer array relations where relations[j] = [prevCoursej, nextCoursej] denotes that course prevCoursej has to be completed before course nextCoursej…
leetcode.com 2023-10-20
🟡341.flatten-nested-list-iterator
🏷️ Tags
#stack #tree #depth_first_search #design #queue #iterator
🟡341.flatten-nested-list-iterator
🏷️ Tags
#stack #tree #depth_first_search #design #queue #iterator
Telegraph
flatten-nested-list-iterator
You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an iterator to flatten it. Implement the NestedIterator class: