leetcode.com 2023-10-09
🟡34.find-first-and-last-position-of-element-in-sorted-array
🏷️ Tags
#array #binary_search
🟡34.find-first-and-last-position-of-element-in-sorted-array
🏷️ Tags
#array #binary_search
Telegraph
find-first-and-last-position-of-element-in-sorted-array
Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. Example 1:…
leetcode.com 2023-10-10
🔴2009.minimum-number-of-operations-to-make-array-continuous
🏷️ Tags
#array #binary_search
🔴2009.minimum-number-of-operations-to-make-array-continuous
🏷️ Tags
#array #binary_search
Telegraph
minimum-number-of-operations-to-make-array-continuous
You are given an integer array nums. In one operation, you can replace any element in nums with any integer. nums is considered continuous if both of the following conditions are fulfilled:
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 。 在一步 操作 中: