#3727
Maximum Alternating Sum of Squares
specialist · 705 · lc medium +30 · 61.2% accepted · 70 likes · top 61%
Description
Given an integer array nums that you may rearrange freely, return the maximum alternating score defined as arr[0]2 - arr[1]2 + arr[2]2 - arr[3]2 + ... after choosing the optimal arrangement.
Code
1
2
3