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: