class Solution:
def minOperations(self, nums: List[int], k: int) -> int:
x, ans = 0, 0
for num in nums: x ^= num
while k or x:
if x & 1 != k & 1: ans += 1
x //= 2
k //= 2
return ans
이런 문제는 왜 내는걸까... 도대체
class Solution:
def minOperations(self, nums: List[int], k: int) -> int:
x, ans = 0, 0
for num in nums: x ^= num
while k or x:
if x & 1 != k & 1: ans += 1
x //= 2
k //= 2
return ans
이런 문제는 왜 내는걸까... 도대체
댓글 0