NvidiaOA #8
Last Robot Score
Estimated EasyStatement and editorial — judging is being prepared
Topics (AI-labelled)Stacks & Heaps
Robots compete by score. While at least two robots remain, take the two
Constraints
The competition always uses the two currently highest scores.
Example 1
Input:
scores = [10,4,7,3]
Output:
2
Explanation: 10 and 7 leave 3, then 4 and 3 leave 1, then 3 and 1 leave 2. The last remaining robot has score 2.
Example 2
Input:
scores = [8,5,3]
Output:
0
Explanation: 8 and 5 leave 3, then the two 3s cancel.
Editorial
Loading solution…