leetcode.cn 2026-02-21
🟢762.prime-number-of-set-bits-in-binary-representation
🏷️ Tags
#bit_manipulation #math
🟢762.prime-number-of-set-bits-in-binary-representation
🏷️ Tags
#bit_manipulation #math
Telegraph
prime-number-of-set-bits-in-binary-representation
给你两个整数 left 和 right ,在闭区间 [left, right] 范围内,统计并返回 计算置位位数为质数 的整数个数。 计算置位位数 就是二进制表示中 1 的个数。
leetcode.com 2026-02-21
🟢762.prime-number-of-set-bits-in-binary-representation
🏷️ Tags
#bit_manipulation #math
🟢762.prime-number-of-set-bits-in-binary-representation
🏷️ Tags
#bit_manipulation #math
Telegraph
prime-number-of-set-bits-in-binary-representation
Given two integers left and right, return the count of numbers in the inclusive range [left, right] having a prime number of set bits in their binary representation. Recall that the number of set bits an integer has is the number of 1's present when written…
leetcode.cn 2026-02-23
🟡1461.check-if-a-string-contains-all-binary-codes-of-size-k
🏷️ Tags
#bit_manipulation #hash_table #string #hash_function #rolling_hash
🟡1461.check-if-a-string-contains-all-binary-codes-of-size-k
🏷️ Tags
#bit_manipulation #hash_table #string #hash_function #rolling_hash
Telegraph
check-if-a-string-contains-all-binary-codes-of-size-k
给你一个二进制字符串 s 和一个整数 k 。如果所有长度为 k 的二进制字符串都是 s 的子串,请返回 true ,否则请返回 false 。 示例 1: 输入:s = "00110110", k = 2 输出:true 解释:长度为 2 的二进制串包括 "00","01","10" 和 "11"。它们分别是 s 中下标为 0,1,3,2 开始的长度为 2 的子串。 示例 2: 输入:s = "0110", k = 1 输出:true 解释:长度为 1 的二进制串包括 "0" 和 "1",显然它们都是…
leetcode.com 2026-02-23
🟡1461.check-if-a-string-contains-all-binary-codes-of-size-k
🏷️ Tags
#bit_manipulation #hash_table #string #hash_function #rolling_hash
🟡1461.check-if-a-string-contains-all-binary-codes-of-size-k
🏷️ Tags
#bit_manipulation #hash_table #string #hash_function #rolling_hash
Telegraph
check-if-a-string-contains-all-binary-codes-of-size-k
Given a binary string s and an integer k, return true if every binary code of length k is a substring of s. Otherwise, return false. Example 1: Input: s = "00110110", k = 2 Output: true Explanation: The binary codes of length 2 are "00", "01", "10" and…
leetcode.cn 2026-02-24
🟢1022.sum-of-root-to-leaf-binary-numbers
🏷️ Tags
#tree #depth_first_search #binary_tree
🟢1022.sum-of-root-to-leaf-binary-numbers
🏷️ Tags
#tree #depth_first_search #binary_tree
Telegraph
sum-of-root-to-leaf-binary-numbers
给出一棵二叉树,其上每个结点的值都是 0 或 1 。每一条从根到叶的路径都代表一个从最高有效位开始的二进制数。
leetcode.com 2026-02-24
🟢1022.sum-of-root-to-leaf-binary-numbers
🏷️ Tags
#tree #depth_first_search #binary_tree
🟢1022.sum-of-root-to-leaf-binary-numbers
🏷️ Tags
#tree #depth_first_search #binary_tree
Telegraph
sum-of-root-to-leaf-binary-numbers
You are given the root of a binary tree where each node has a value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit.
leetcode.cn 2026-02-25
🟢1356.sort-integers-by-the-number-of-1-bits
🏷️ Tags
#bit_manipulation #array #counting #sorting
🟢1356.sort-integers-by-the-number-of-1-bits
🏷️ Tags
#bit_manipulation #array #counting #sorting
Telegraph
sort-integers-by-the-number-of-1-bits
给你一个整数数组 arr 。请你将数组中的元素按照其二进制表示中数字 1 的数目升序排序。 如果存在多个数字二进制中 1 的数目相同,则必须将它们按照数值大小升序排列。 请你返回排序后的数组。 示例 1: 输入:arr = [0,1,2,3,4,5,6,7,8] 输出:[0,1,2,4,8,3,5,6,7] 解释:[0] 是唯一一个有 0 个 1 的数。 [1,2,4,8] 都有 1 个 1 。 [3,5,6] 有 2 个 1 。 [7] 有 3 个 1 。 按照 1 的个数排序得到的结果数组为 [0…
leetcode.com 2026-02-25
🟢1356.sort-integers-by-the-number-of-1-bits
🏷️ Tags
#bit_manipulation #array #counting #sorting
🟢1356.sort-integers-by-the-number-of-1-bits
🏷️ Tags
#bit_manipulation #array #counting #sorting
Telegraph
sort-integers-by-the-number-of-1-bits
You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case of two or more integers have the same number of 1's you have to sort them in ascending order. Return the…
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。