3683. Earliest Time to Finish One Task Easy

@problem@discussion
#Array



1/**
2 * [3683] Earliest Time to Finish One Task
3 *
4 * You are given a 2D integer array tasks where tasks[i] = [si, ti].
5 * Each [si, ti] in tasks represents a task with start time si that takes ti units of time to finish.
6 * Return the earliest time at which at least one task is finished.
7 *  
8 * <strong class="example">Example 1:
9 * <div class="example-block">
10 * Input: <span class="example-io">tasks = [[1,6],[2,3]]</span>
11 * Output: <span class="example-io">5</span>
12 * Explanation:
13 * The first task starts at time t = 1 and finishes at time 1 + 6 = 7. The second task finishes at time 2 + 3 = 5. You can finish one task at time 5.
14 * </div>
15 * <strong class="example">Example 2:
16 * <div class="example-block">
17 * Input: <span class="example-io">tasks = [[100,100],[100,100],[100,100]]</span>
18 * Output: <span class="example-io">200</span>
19 * Explanation:
20 * All three tasks finish at time 100 + 100 = 200.
21 * </div>
22 *  
23 * Constraints:
24 * 
25 * 	1 <= tasks.length <= 100
26 * 	tasks[i] = [si, ti]
27 * 	1 <= si, ti <= 100
28 * 
29 */
30pub struct Solution {}
31
32// problem: https://leetcode.com/problems/earliest-time-to-finish-one-task/
33// discuss: https://leetcode.com/problems/earliest-time-to-finish-one-task/discuss/?currentPage=1&orderBy=most_votes&query=
34
35// submission codes start here
36
37impl Solution {
38    pub fn earliest_time(tasks: Vec<Vec<i32>>) -> i32 {
39        0
40    }
41}
42
43// submission codes end
44
45#[cfg(test)]
46mod tests {
47    use super::*;
48
49    #[test]
50    fn test_3683() {
51    }
52}
53

Back
© 2026 bowen.ge All Rights Reserved.