-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maximum Element-Sum of a Complete Subset of Indices #21
Comments
Input: nums = [8,7,3,5,7,2,4,9] |
Input: nums = [5,10,3,10,1,13,7,9,4] |
idx 1_2 3 4 5 6 7 8 9 To find the subsets of perfect squares from the above table. |
You are given a 1-indexed array nums of n integers.
A set of numbers is complete if the product of every pair of its elements is a perfect square.
For a subset of the indices set {1, 2, ..., n} represented as {i1, i2, ..., ik}, we define its element-sum as: nums[i1] + nums[i2] + ... + nums[ik].
Return the maximum element-sum of a complete subset of the indices set {1, 2, ..., n}.
A perfect square is a number that can be expressed as the product of an integer by itself.
The text was updated successfully, but these errors were encountered: