← ALL NOTES
Array

3727. Maximum Alternating Sum of Squares

The alternating sign pattern fixes how many plus slots and minus slots exist, and nothing else. For n elements there are (n + 1) / 2 additions at positions 0, 2, 4, ... and n / 2 subtractions at the odd ones. Since I can permute freely, any element can land in any slot, so the arrangement itself car

Loading…