Skip to content

Practice Keep Multiplying Found Values by Two

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#2154
LeetCode Problem

Keep Multiplying Found Values by Two

Problem Statement

Search nums for original. If it is present, double original and search again using that new value. Stop as soon as the current value is absent and return it.

Source: Keep Multiplying Found Values by Two on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [5,3,6,1,12], original = 3
Output
24

# Example 2

Input
nums = [2,7,9], original = 4
Output
4

Constraints

1 <= nums.length <= 1000
1 <= nums[i], original <= 1000

Related LeetCode Problems

Practice more problems similar to Keep Multiplying Found Values by Two.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.