← 返回 snapchat 的题目列表Subset Product from Primes
类型:online_judge
Given a list of prime numbers, output all possible products of the primes. The result should not contain duplicates.
Input
An array containing n prime numbers, where n is a positive integer.
Output
An array containing all possible products of the input primes, returned without duplicates.
Example
Input: [2, 3, 11]
Output: [2, 3, 11, 6, 22, 33, 66]
Constraints
Do not use built-in collection types' deduplication features.
Example
Input
2 3 11