2154. Keep Multiplying Found Values by Two

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2154

class Solution:
    def findFinalValue(self, nums: List[int], original: int) -> int:
        s = set(nums)
        while original in s:
            original <<= 1
        return original