Re: [闲聊] 每日leetcode

楼主: dont   2024-11-09 10:34:44
3133. Minimum Array End
## 思路
AND之后是x, 所以每个值都有x的bit
阵列第i个值 = 原本的x 加上 在剩下的0中塞入i-1的bit值
Input: n = 3, x = 5
arr = [5 (0101), 7 (0111), 13 (1101)]
x = 0101 (5)
1 0 (2)

Links booklink

Contact Us: admin [ a t ] ucptt.com