[LeetCode] Earliest Time to Finish One Task

3683. Earliest Time to Finish One Task

You are given a 2D integer array tasks where tasks[i] = [si, ti].

Each [si, ti] in tasks represents a task with start time si that takes ti units of time to finish.

Return the earliest time at which at least one task is finished.

1
2
3
4
5
6
7
8
class Solution {
public:
int earliestTime(vector<vector<int>>& tasks) {
int res = INT_MAX;
for(auto& t : tasks) res = min(res, t[0] + t[1]);
return res;
}
};
Author: Song Hayoung
Link: https://songhayoung.github.io/2025/09/19/PS/LeetCode/earliest-time-to-finish-one-task/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.