LeetCode 1701. Average Waiting Time方法2
2023-05-20 13:27 作者:您是打尖兒還是住店呢 | 我要投稿
就不寫題目了,
方法2是比較啰嗦的,每次記錄廚師做完菜的時(shí)間,放到數(shù)組中,
每次去判斷客人到的時(shí)候,跟廚師做完菜的時(shí)間,根據(jù)這個(gè)區(qū)判斷客人的等待時(shí)間。
最后返回?cái)?shù)值即可;
Runtime:?4 ms, faster than?36.84%?of?Java?online submissions for?Average Waiting Time.
Memory Usage:?81.5 MB, less than?97.74%?of?Java?online submissions for?Average Waiting Time.
標(biāo)簽: