2651. Calculate Delayed Arrival Time Easy
1/**
2 * [2651] Calculate Delayed Arrival Time
3 *
4 * You are given a positive integer arrivalTime denoting the arrival time of a train in hours, and another positive integer delayedTime denoting the amount of delay in hours.
5 * Return the time when the train will arrive at the station.
6 * Note that the time in this problem is in 24-hours format.
7 *
8 * <strong class="example">Example 1:
9 *
10 * Input: arrivalTime = 15, delayedTime = 5
11 * Output: 20
12 * Explanation: Arrival time of the train was 15:00 hours. It is delayed by 5 hours. Now it will reach at 15+5 = 20 (20:00 hours).
13 *
14 * <strong class="example">Example 2:
15 *
16 * Input: arrivalTime = 13, delayedTime = 11
17 * Output: 0
18 * Explanation: Arrival time of the train was 13:00 hours. It is delayed by 11 hours. Now it will reach at 13+11=24 (Which is denoted by 00:00 in 24 hours format so return 0).
19 *
20 *
21 * Constraints:
22 *
23 * 1 <= arrivaltime < 24
24 * 1 <= delayedTime <= 24
25 *
26 */
27pub struct Solution {}
28
29// problem: https://leetcode.com/problems/calculate-delayed-arrival-time/
30// discuss: https://leetcode.com/problems/calculate-delayed-arrival-time/discuss/?currentPage=1&orderBy=most_votes&query=
31
32// submission codes start here
33
34impl Solution {
35 pub fn find_delayed_arrival_time(arrival_time: i32, delayed_time: i32) -> i32 {
36 0
37 }
38}
39
40// submission codes end
41
42#[cfg(test)]
43mod tests {
44 use super::*;
45
46 #[test]
47 fn test_2651() {
48 }
49}
50
Back
© 2025 bowen.ge All Rights Reserved.