일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 30분
- 영어공부
- FIT XR
- 리얼 클래스
- Problem Solving
- Daily Challenge
- 스탭퍼
- 매일
- 만화도
- 3줄정리
- 10분
- 괜찮음
- 화상영어
- 링피트
- 영어원서읽기
- English
- 쓰릴오브파이트
- Writing
- 개발자
- realclass
- 파비최
- 뭐든
- 사이드
- 미드시청
- 월간
- 잡생각
- 프로젝트
- leetcode
- 운동
- 읽기
Archives
- Today
- Total
파비의 매일매일 공부기록
2023.11.07 Today's Challenge 본문
Last Moment Before All Ants Fall Out of a Plank - LeetCode
Can you solve this real interview question? Last Moment Before All Ants Fall Out of a Plank - We have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with a speed of 1 unit per second. Some of the ants move to the l
leetcode.com
개미 게임 ㅋㅋㅋ
class Solution:
def getLastMoment(self, n: int, left: List[int], right: List[int]) -> int:
ans = 0
for num in left:
ans = max(ans, num)
for num in right:
ans = max(ans, n - num)
return ans
반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
2023.11.09 Today's Challenge (0) | 2023.11.09 |
---|---|
2023.11.08 Today's Challenge (0) | 2023.11.08 |
2023.11.06 Today's Challenge (1) | 2023.11.06 |
2023.11.05 Today's Challenge (0) | 2023.11.05 |
2023.11.04 Today's Challenge (0) | 2023.11.04 |
Comments