1 minute read

Given a list of integers nums, return whether the largest number is bigger than the second-largest number by more than two times.

Constraints

  • 2 ≤ n ≤ 100,000 where n is the length of nums

https://binarysearch.com/problems/Largest-Number-By-Two-Times

Examples

Example 1

Input

  • nums = [3, 6, 15]

Output

  • answer = True

Explanation

15 is bigger than 12 (2 * 6).

Example 2

Input

  • nums = [3, 6, 9]

Output

  • answer = False

Explanation

9 is not bigger than 2 * 6.

Example 3

Input

  • nums = [3, 6, 12]

Output

  • answer = False

Explanation

12 is not bigger than 2 * 6, they’re equal.

Solution

Categories:

Updated:

Leave a comment