首页 > TAG信息列表 > lcci

位运算 翻转数位

  You have an integer and you can flip exactly one bit from a 0 to a 1. Write code to find the length of the longest sequence of 1s you could create. Example 1: Input: num = 1775(110111011112)Output: 8Example 2: Input: num = 7(01112)Output: 4 来源:力扣(LeetCo