5 XP challenge

Sum Distinct Endpoints

very easy
Build it yourself · 3 min
1 Learn2 Predict3 Solve

Task
Your mission

Return zero for an empty list, its only value for a one-item list, or first + last otherwise. values has 0 to 30 integers from -100 to 100.

Examples

InputReturn
values = []0
values = [7]7

Your code

Write your answer inside Solution, then use return to send it back.

Loading starter code...

Try examples runs the public examples. Check my code checks your full answer and saves your completion.