LeetNote
Categories
Problems
Patterns
🔍 Search
Ladders
Dashboard
🌙
☀️
Categories
/
Patterns
/
位元技巧
💡 Patterns · 字串・位元・數學
位元技巧
Bit Manipulation
17 題(12 題以此為主技法)
🎯 何時用
計位元數、找唯一數、子集列舉、無加號運算。
🧩 模板心法
XOR 自反消對、x&(x-1) 去最低位 1、x&-x 取最低位、用位元枚舉子集。
Easy
8 題
#190
Reverse Bits
主
🔢 Bit Manipulation
★★★★★
#191
Number of 1 Bits
主
🔢 Bit Manipulation
★★★★★
#268
Missing Number
主
🔢 Bit Manipulation
★★★★★
#338
Counting Bits
主
🔢 Bit Manipulation
★★★★★
#136
Single Number
主
🔢 Bit Manipulation
★★★★
★
#67
Add Binary
主
🔢 Bit Manipulation
★★★
★★
#989
Add to Array-Form of Integer
主
🔢 Bit Manipulation
★★★
★★
#1470
Shuffle the Array
主
🔢 Bit Manipulation
★★★
★★
Medium
8 題
#371
Sum of Two Integers
主
🔢 Bit Manipulation
★★★★★
#7
Reverse Integer
主
🔢 Bit Manipulation
★★★
★★
#29
Divide Two Integers
主
🔢 Bit Manipulation
★★★
★★
#1461
Check if a String Contains all Binary Codes of Size K
主
🗂️ Arrays & Hashing
★★★
★★
#78
Subsets
🔙 Backtracking
★★★★
★
#187
Repeated DNA Sequences
🗂️ Arrays & Hashing
★★★
★★
#473
Matchsticks to Square
🔙 Backtracking
★★★
★★
#1239
Maximum Length of a Concatenated String With Unique Characters
🔙 Backtracking
★★★
★★
Hard
1 題
#52
N Queens II
🔙 Backtracking
★★★
★★