leetcode.cn 2026-02-26
🟡1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one
🏷️ Tags
#bit_manipulation #string #simulation
🟡1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one
🏷️ Tags
#bit_manipulation #string #simulation
Telegraph
number-of-steps-to-reduce-a-number-in-binary-representation-to-one
给你一个以二进制形式表示的数字 s 。请你返回按下述规则将其减少到 1 所需要的步骤数:
leetcode.com 2026-02-26
🟡1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one
🏷️ Tags
#bit_manipulation #string #simulation
🟡1404.number-of-steps-to-reduce-a-number-in-binary-representation-to-one
🏷️ Tags
#bit_manipulation #string #simulation
Telegraph
number-of-steps-to-reduce-a-number-in-binary-representation-to-one
Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:
leetcode.cn 2026-02-27
🔴3666.minimum-operations-to-equalize-binary-string
🏷️ Tags
#breadth_first_search #union_find #math #string #ordered_set
🔴3666.minimum-operations-to-equalize-binary-string
🏷️ Tags
#breadth_first_search #union_find #math #string #ordered_set
Telegraph
minimum-operations-to-equalize-binary-string
给你一个二进制字符串 s 和一个整数 k。
leetcode.cn 2026-02-28
🟡1680.concatenation-of-consecutive-binary-numbers
🏷️ Tags
#bit_manipulation #math #simulation
🟡1680.concatenation-of-consecutive-binary-numbers
🏷️ Tags
#bit_manipulation #math #simulation
Telegraph
concatenation-of-consecutive-binary-numbers
给你一个整数 n ,请你将 1 到 n 的二进制表示连接起来,并返回连接结果对应的 十进制 数字对 109 + 7 取余的结果。 示例 1: 输入:n = 1 输出:1 解释:二进制的 "1" 对应着十进制的 1 。 示例 2: 输入:n = 3 输出:27 解释:二进制下,1,2 和 3 分别对应 "1" ,"10" 和 "11" 。 将它们依次连接,我们得到 "11011" ,对应着十进制的 27 。 示例 3: 输入:n = 12 输出:505379714 解释:连接结果为 "11011100…
leetcode.com 2026-02-28
🟡1680.concatenation-of-consecutive-binary-numbers
🏷️ Tags
#bit_manipulation #math #simulation
🟡1680.concatenation-of-consecutive-binary-numbers
🏷️ Tags
#bit_manipulation #math #simulation
Telegraph
concatenation-of-consecutive-binary-numbers
Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109 + 7. Example 1: Input: n = 1 Output: 1 Explanation: "1" in binary corresponds to the decimal value 1. Example…
leetcode.cn 2026-03-01
🟡1689.partitioning-into-minimum-number-of-deci-binary-numbers
🏷️ Tags
#greedy #string
🟡1689.partitioning-into-minimum-number-of-deci-binary-numbers
🏷️ Tags
#greedy #string
Telegraph
partitioning-into-minimum-number-of-deci-binary-numbers
如果一个十进制数字不含任何前导零,且每一位上的数字不是 0 就是 1 ,那么该数字就是一个 十-二进制数 。例如,101 和 1100 都是 十-二进制数,而 112 和 3001 不是。 给你一个表示十进制整数的字符串 n ,返回和为 n 的 十-二进制数 的最少数目。 示例 1: 输入:n = "32" 输出:3 解释:10 + 11 + 11 = 32 示例 2: 输入:n = "82734" 输出:8 示例 3: 输入:n = "27346209830709182346" 输出:9 提示:
leetcode.com 2026-03-01
🟡1689.partitioning-into-minimum-number-of-deci-binary-numbers
🏷️ Tags
#greedy #string
🟡1689.partitioning-into-minimum-number-of-deci-binary-numbers
🏷️ Tags
#greedy #string
Telegraph
partitioning-into-minimum-number-of-deci-binary-numbers
A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not. Given a string n that represents a positive decimal integer, return the minimum…
leetcode.cn 2026-03-07
🟡1888.minimum-number-of-flips-to-make-the-binary-string-alternating
🏷️ Tags
#string #dynamic_programming #sliding_window
🟡1888.minimum-number-of-flips-to-make-the-binary-string-alternating
🏷️ Tags
#string #dynamic_programming #sliding_window
Telegraph
minimum-number-of-flips-to-make-the-binary-string-alternating
给你一个二进制字符串 s 。你可以按任意顺序执行以下两种操作任意次:
leetcode.com 2026-03-07
🟡1888.minimum-number-of-flips-to-make-the-binary-string-alternating
🏷️ Tags
#string #dynamic_programming #sliding_window
🟡1888.minimum-number-of-flips-to-make-the-binary-string-alternating
🏷️ Tags
#string #dynamic_programming #sliding_window
Telegraph
minimum-number-of-flips-to-make-the-binary-string-alternating
You are given a binary string s. You are allowed to perform two types of operations on the string in any sequence:
leetcode.cn 2026-03-08
🟡1980.find-unique-binary-string
🏷️ Tags
#array #hash_table #string #backtracking
🟡1980.find-unique-binary-string
🏷️ Tags
#array #hash_table #string #backtracking
Telegraph
find-unique-binary-string
给你一个字符串数组 nums ,该数组由 n 个 互不相同 的二进制字符串组成,且每个字符串长度都是 n 。请你找出并返回一个长度为 n 且 没有出现 在 nums 中的二进制字符串。如果存在多种答案,只需返回 任意一个 即可。 示例 1: 输入:nums = ["01","10"] 输出:"11" 解释:"11" 没有出现在 nums 中。"00" 也是正确答案。 示例 2: 输入:nums = ["00","01"] 输出:"11" 解释:"11" 没有出现在 nums 中。"10" 也是正确答案。…
leetcode.cn 2026-03-09
🟡3129.find-all-possible-stable-binary-arrays-i
🏷️ Tags
#dynamic_programming #prefix_sum
🟡3129.find-all-possible-stable-binary-arrays-i
🏷️ Tags
#dynamic_programming #prefix_sum
Telegraph
find-all-possible-stable-binary-arrays-i
给你 3 个正整数 zero ,one 和 limit 。 一个 二进制数组 arr 如果满足以下条件,那么我们称它是 稳定的 :