Daily challenge for 2026-10-17
655. Sensor Final Readings Sum
You are given a list of sensor reading pairs records, where each element is a list [sensor_id, reading] containing an integer sensor_id and an integer reading. Records arrive in chronological order, meaning a later record for the same sensor_id overwrites any previous reading for that sensor.
Return the sum of the final (most recent) readings across all distinct sensors. If records is empty, return 0.
Constraints:
There are 0–1,000 records. Each record is exactly [sensor_id, reading]; both entries are integers with absolute value at most 1,000,000. Repeated sensor ids overwrite earlier readings.
Example:
Input: records = [[1, 10], [2, 5], [1, 20], [3, -5]]
Output: 20
Run this challenge interactively in Python or JavaScript when the app loads.