BackmediumUncategorized uncategorized medium

Minimum Timestamp Difference Path Solution

Problem Statement

Given a list of relay points with their unique identifiers and timestamps, determine the minimum total timestamp difference for the most efficient path, where the path with the minimum total timestamp difference between consecutive relay points is the most efficient path.

Example 1
Input
{"relayPoints":[{"id":1,"timestamp":10},{"id":2,"timestamp":20},{"id":3,"timestamp":30}]}
Output
20

Explanation: The total timestamp difference is (20-10) + (30-20) = 10 + 10 = 20

Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free