#2862

Maximum Element-Sum of a Complete Subset of Indices

master · 1645 · lc hard +32 · 42.8% accepted · 233 likes · top 24%

Description

A 1-indexed array nums is given. Select a complete subset of indices where every product of any two selected indices is a perfect square.

Return the maximum possible sum of nums values at the selected indices.

Code

1
2
3