leetcode.cn 2023-12-26
🔴1349.maximum-students-taking-exam
🏷️ Tags
#bit_manipulation #array #dynamic_programming #bitmask #matrix
🔴1349.maximum-students-taking-exam
🏷️ Tags
#bit_manipulation #array #dynamic_programming #bitmask #matrix
Telegraph
maximum-students-taking-exam
给你一个 m * n 的矩阵 seats 表示教室中的座位分布。如果座位是坏的(不可用),就用 '#' 表示;否则,用 '.' 表示。 学生可以看到左侧、右侧、左上、右上这四个方向上紧邻他的学生的答卷,但是看不到直接坐在他前面或者后面的学生的答卷。请你计算并返回该考场可以容纳的同时参加考试且无法作弊的 最大 学生人数。 学生必须坐在状况良好的座位上。 示例 1: 输入:seats = [["#",".","#","#",".","#"], [".","#","#","#","#","."], …
leetcode.com 2023-12-27
🟡1578.minimum-time-to-make-rope-colorful
🏷️ Tags
#greedy #array #string #dynamic_programming
🟡1578.minimum-time-to-make-rope-colorful
🏷️ Tags
#greedy #array #string #dynamic_programming
Telegraph
minimum-time-to-make-rope-colorful
Alice has n balloons arranged on a rope. You are given a 0-indexed string colors where colors[i] is the color of the ith balloon. Alice wants the rope to be colorful. She does not want two consecutive balloons to be of the same color, so she asks Bob for…
leetcode.com 2023-12-30
🟢1897.redistribute-characters-to-make-all-strings-equal
🏷️ Tags
#hash_table #string #counting
🟢1897.redistribute-characters-to-make-all-strings-equal
🏷️ Tags
#hash_table #string #counting
Telegraph
redistribute-characters-to-make-all-strings-equal
You are given an array of strings words (0-indexed). In one operation, pick two distinct indices i and j, where words[i] is a non-empty string, and move any character from words[i] to any position in words[j]. Return true if you can make every string in words…
leetcode.com 2023-12-31
🟢1624.largest-substring-between-two-equal-characters
🏷️ Tags
#hash_table #string
🟢1624.largest-substring-between-two-equal-characters
🏷️ Tags
#hash_table #string
Telegraph
largest-substring-between-two-equal-characters
Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1. A substring is a contiguous sequence of characters within a string. Example 1: Input: s = "aa"…
leetcode.com 2024-01-02
🟡2610.convert-an-array-into-a-2d-array-with-conditions
🏷️ Tags
#array #hash_table
🟡2610.convert-an-array-into-a-2d-array-with-conditions
🏷️ Tags
#array #hash_table
Telegraph
convert-an-array-into-a-2d-array-with-conditions
You are given an integer array nums. You need to create a 2D array from nums satisfying the following conditions:
leetcode.cn 2024-01-03
🟡2487.remove-nodes-from-linked-list
🏷️ Tags
#stack #recursion #linked_list #monotonic_stack
🟡2487.remove-nodes-from-linked-list
🏷️ Tags
#stack #recursion #linked_list #monotonic_stack
Telegraph
remove-nodes-from-linked-list
给你一个链表的头节点 head 。 移除每个右侧有一个更大数值的节点。 返回修改后链表的头节点 head 。 示例 1: 输入:head = [5,2,13,3,8] 输出:[13,8] 解释:需要移除的节点是 5 ,2 和 3 。 - 节点 13 在节点 5 右侧。 - 节点 13 在节点 2 右侧。 - 节点 8 在节点 3 右侧。 示例 2: 输入:head = [1,1,1,1] 输出:[1,1,1,1] 解释:每个节点的值都是 1 ,所以没有需要移除的节点。 提示:
leetcode.cn 2024-01-04
🟡2397.maximum-rows-covered-by-columns
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration #matrix
🟡2397.maximum-rows-covered-by-columns
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration #matrix
Telegraph
maximum-rows-covered-by-columns
给你一个下标从 0 开始、大小为 m x n 的二进制矩阵 matrix ;另给你一个整数 numSelect,表示你必须从 matrix 中选择的 不同 列的数量。 如果一行中所有的 1 都被你选中的列所覆盖,则认为这一行被 覆盖 了。 形式上,假设 s = {c1, c2, ...., cnumSelect} 是你选择的列的集合。对于矩阵中的某一行 row ,如果满足下述条件,则认为这一行被集合 s 覆盖: