leetle

Daily challenge for 2026-10-04

642. Total Span of Sorted Marks

Given a list of integer timestamps marks representing when events occurred, sort the timestamps in ascending order and determine the total span between the earliest and latest mark. If the list contains fewer than 2 marks, return 0.

Example:
Input: marks = [8, 3, 14, 5]
Output: 11
Explanation: After sorting, the marks are [3, 5, 8, 14]. The span is 14 - 3 = 11.

Run this challenge interactively in Python or JavaScript when the app loads.