Tap here to switch tabs
Problem
Submissions

Problem: Maximum Alternating Sum of Squares

Maximum Alternating Sum of Squares asks you to reorder an integer array to maximize the sum of squares at even positions minus the sum of squares at odd positions.

Statement

You are given an integer array nums.

The alternating sum of squares of an array indexed starting from 00 is defined as the sum of the squares of elements at even indices minus the sum of the squares of elements at odd indices:

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Alternating Sum of Squares

Maximum Alternating Sum of Squares asks you to reorder an integer array to maximize the sum of squares at even positions minus the sum of squares at odd positions.

Statement

You are given an integer array nums.

The alternating sum of squares of an array indexed starting from 00 is defined as the sum of the squares of elements at even indices minus the sum of the squares of elements at odd indices: