In [75]: x=4

In [76]: y=1

In [77]: str(bin(x ^ y))[2:].count('1')

Out[77]: 2

In [78]:

来自:https://leetcode.com

 

相关文章:

  • 2021-12-20
  • 2021-05-14
  • 2021-08-09
  • 2021-08-07
  • 2022-02-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2021-07-07
相关资源
相似解决方案