Try to solve the Maximum Alternating Sum of Squares problem.
Statement
You are given an integer array nums.
The alternating sum of squares of an array indexed starting from 0 is defined as the sum of the squares of elements at even indices minus the sum of the squares of elements at odd indices:
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Maximum Alternating Sum of Squares
1.
For the input [0], what is the maximum alternating sum of squares?
A.
(1)
B.
(0)
C.
(-1)
D.
(2)
1 / 5
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.
Try to solve the Maximum Alternating Sum of Squares problem.
Statement
You are given an integer array nums.
The alternating sum of squares of an array indexed starting from 0 is defined as the sum of the squares of elements at even indices minus the sum of the squares of elements at odd indices:
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Maximum Alternating Sum of Squares
1.
For the input [0], what is the maximum alternating sum of squares?
A.
(1)
B.
(0)
C.
(-1)
D.
(2)
1 / 5
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.