leetcode.com 2025-10-23
🟢3461.check-if-digits-are-equal-in-string-after-operations-i
🏷️ Tags
#math #string #combinatorics #number_theory #simulation
🟢3461.check-if-digits-are-equal-in-string-after-operations-i
🏷️ Tags
#math #string #combinatorics #number_theory #simulation
Telegraph
check-if-digits-are-equal-in-string-after-operations-i
You are given a string s consisting of digits. Perform the following operation repeatedly until the string has exactly two digits:
❤1
leetcode.cn 2025-11-03
🟡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 把 n 个气球排列在一根绳子上。给你一个下标从 0 开始的字符串 colors ,其中 colors[i] 是第 i 个气球的颜色。 Alice 想要把绳子装扮成 五颜六色的 ,且她不希望两个连续的气球涂着相同的颜色,所以她喊来 Bob 帮忙。Bob 可以从绳子上移除一些气球使绳子变成 彩色 。给你一个 下标从 0 开始 的整数数组 neededTime ,其中 neededTime[i] 是 Bob 从绳子上移除第 i 个气球需要的时间(以秒为单位)。 返回 Bob 使绳子变成 彩色 需要的…
leetcode.com 2025-11-03
🟡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.cn 2025-11-13
🟡3228.maximum-number-of-operations-to-move-ones-to-the-end
🏷️ Tags
#greedy #string #counting
🟡3228.maximum-number-of-operations-to-move-ones-to-the-end
🏷️ Tags
#greedy #string #counting
Telegraph
maximum-number-of-operations-to-move-ones-to-the-end
给你一个 二进制字符串 s。 你可以对这个字符串执行 任意次 下述操作:
leetcode.com 2025-11-13
🟡3228.maximum-number-of-operations-to-move-ones-to-the-end
🏷️ Tags
#greedy #string #counting
🟡3228.maximum-number-of-operations-to-move-ones-to-the-end
🏷️ Tags
#greedy #string #counting
Telegraph
maximum-number-of-operations-to-move-ones-to-the-end
You are given a binary string s. You can perform the following operation on the string any number of times:
leetcode.cn 2025-11-15
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
Telegraph
count-the-number-of-substrings-with-dominant-ones
给你一个二进制字符串 s。 请你统计并返回其中 1 显著 的 子字符串 的数量。 如果字符串中 1 的数量 大于或等于 0 的数量的 平方,则认为该字符串是一个 1 显著 的字符串 。 示例 1: 输入:s = "00011" 输出:5 解释: 1 显著的子字符串如下表所示。
leetcode.com 2025-11-15
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
Telegraph
count-the-number-of-substrings-with-dominant-ones
You are given a binary string s. Return the number of substrings with dominant ones. A string has dominant ones if the number of ones in the string is greater than or equal to the square of the number of zeros in the string. Example 1: Input: s = "00011"…
leetcode.cn 2025-11-21
🟡1930.unique-length-3-palindromic-subsequences
🏷️ Tags
#bit_manipulation #hash_table #string #prefix_sum
🟡1930.unique-length-3-palindromic-subsequences
🏷️ Tags
#bit_manipulation #hash_table #string #prefix_sum
Telegraph
unique-length-3-palindromic-subsequences
给你一个字符串 s ,返回 s 中 长度为 3 的不同回文子序列 的个数。 即便存在多种方法来构建相同的子序列,但相同的子序列只计数一次。 回文 是正着读和反着读一样的字符串。 子序列 是由原字符串删除其中部分字符(也可以不删除)且不改变剩余字符之间相对顺序形成的一个新字符串。
leetcode.com 2025-11-21
🟡1930.unique-length-3-palindromic-subsequences
🏷️ Tags
#bit_manipulation #hash_table #string #prefix_sum
🟡1930.unique-length-3-palindromic-subsequences
🏷️ Tags
#bit_manipulation #hash_table #string #prefix_sum
Telegraph
unique-length-3-palindromic-subsequences
Given a string s, return the number of unique palindromes of length three that are a subsequence of s. Note that even if there are multiple ways to obtain the same subsequence, it is still only counted once. A palindrome is a string that reads the same forwards…
leetcode.cn 2025-12-14
🔴2147.number-of-ways-to-divide-a-long-corridor
🏷️ Tags
#math #string #dynamic_programming
🔴2147.number-of-ways-to-divide-a-long-corridor
🏷️ Tags
#math #string #dynamic_programming
Telegraph
number-of-ways-to-divide-a-long-corridor
在一个图书馆的长廊里,有一些座位和装饰植物排成一列。给你一个下标从 0 开始,长度为 n 的字符串 corridor ,它包含字母 'S' 和 'P' ,其中每个 'S' 表示一个座位,每个 'P' 表示一株植物。 在下标 0 的左边和下标 n - 1 的右边 已经 分别各放了一个屏风。你还需要额外放置一些屏风。每一个位置 i - 1 和 i 之间(1 <= i <= n - 1),至多能放一个屏风。 请你将走廊用屏风划分为若干段,且每一段内都 恰好有两个座位 ,而每一段内植物的数目没有要求。可能有多种…
leetcode.com 2025-12-14
🔴2147.number-of-ways-to-divide-a-long-corridor
🏷️ Tags
#math #string #dynamic_programming
🔴2147.number-of-ways-to-divide-a-long-corridor
🏷️ Tags
#math #string #dynamic_programming
Telegraph
number-of-ways-to-divide-a-long-corridor
Along a long library corridor, there is a line of seats and decorative plants. You are given a 0-indexed string corridor of length n consisting of letters 'S' and 'P' where each 'S' represents a seat and each 'P' represents a plant. One room divider has already…