2023-09-08力扣每日一题

链接:

2651. 计算列车到站时间

题意:

不看日期只看时间

解:

实际代码:

c++ 复制代码
还看!你怎么肥四?
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
int findDelayedArrivalTime(int arrivalTime, int delayedTime)
{
    return (arrivalTime+delayedTime)>=24  ?(arrivalTime+delayedTime-24):arrivalTime+delayedTime;
}

限制:

  • 1 <= arrivaltime < 24
  • 1 <= delayedTime <= 24
相关推荐
小刘不想改BUG2 小时前
LeetCode 70 爬楼梯(Java)
java·算法·leetcode
sz66cm4 小时前
LeetCode刷题 -- 542. 01矩阵 基于 DFS 更新优化的多源最短路径实现
leetcode·矩阵·深度优先
爱coding的橙子6 小时前
每日算法刷题Day24 6.6:leetcode二分答案2道题,用时1h(下次计时20min没写出来直接看题解,节省时间)
java·算法·leetcode
慢慢慢时光6 小时前
leetcode sql50题
算法·leetcode·职场和发展
pay顿6 小时前
力扣LeetBook数组和字符串--二维数组
算法·leetcode
岁忧6 小时前
(nice!!!)(LeetCode每日一题)2434. 使用机器人打印字典序最小的字符串(贪心+栈)
java·c++·算法·leetcode·职场和发展·go
Tisfy6 小时前
LeetCode 2434.使用机器人打印字典序最小的字符串:贪心(栈)——清晰题解
leetcode·机器人·字符串·题解·贪心·
dying_man7 小时前
LeetCode--18.四数之和
算法·leetcode
客卿12312 小时前
力扣100-移动0
算法·leetcode·职场和发展
緈福的街口18 小时前
【leetcode】347. 前k个高频元素
算法·leetcode·职场和发展