2708. Maximum Strength of a Group

You are given a

0-indexedinteger array`nums`

representing the score of students in an exam. The teacher would like to form onenon-emptygroup of students with maximalstrength, where the strength of a group of students of indices`i0`

,`i1`

,`i2`

, … ,`ik`

is defined as`nums[i0] * nums[i1] * nums[i2] * ... * nums[ik]`

.Return

the maximum strength of a group the teacher can create.

1 | class Solution { |