1250. Check If It Is a Good Array
https://leetcode.com/problems/check-if-it-is-a-good-array
Description
Given an array nums
of positive integers. Your task is to select some subset of nums
, multiply each element by an integer and add all these numbers. The array is said to be goodif you can obtain a sum of 1
from the array by any possible subset and multiplicand.
Return True
if the array is goodotherwise return False
.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 10^5
1 <= nums[i] <= 10^9
ac
Last updated