Maximum Strength of a Group

You are given an integer array nums. Choose a non-empty subset of its elements. The strength of the chosen subset is the product of its elements. Return the maximum strength you can achieve. Elements that are not chosen are simply left out, and the chosen subset must contain at least one element.

Examples
Input: [3,-1,-5,2,5,-9]
Output: 1350
Hints

Maximum Strength of a Group

You are given an integer array nums. Choose a non-empty subset of its elements. The strength of the chosen subset is the product of its elements. Return the maximum strength you can achieve. Elements that are not chosen are simply left out, and the chosen subset must contain at least one element.