#2651
Easy Algorithms Calculate delayed arrival time
Math
75.6% acceptance
Feb 25, 2026
291
53
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.
Return the time when the train will arrive at the station.
Note that the time in this problem is in 24-hours format.
Solution
Rust
Time O(1)
Space O(1)
impl Solution {
pub fn find_delayed_arrival_time(arrival_time: i32, delayed_time: i32) -> i32 {
(arrival_time + delayed_time) % 24
}
}