Practice Maximum Element-Sum of a Complete Subset of Indices
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a 1-indexed array nums. Your task is to select a complete subset from nums where every pair of selected indices multiplied is a perfect square,. i. e. if you select ai and aj, i * j must be a perfect square. Return the sum of the complete subset with the maximum sum.
Source: Maximum Element-Sum of a Complete Subset of Indices on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [8,7,3,5,7,2,4,9]
16
# Example 2
nums = [8,10,3,8,1,13,7,9,4]
20
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Element-Sum of a Complete Subset of Indices.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.