| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- Daily Challenge
- English
- 월간
- Problem Solving
- 미드시청
- 개발자
- 잡생각
- realclass
- Writing
- 파비최
- 뭐든
- 운동
- 10분
- 프로젝트
- 3줄정리
- 읽기
- 영어공부
- FIT XR
- 화상영어
- leetcode
- 링피트
- 사이드
- 괜찮음
- 리얼 클래스
- 스탭퍼
- 영어원서읽기
- 30분
- 쓰릴오브파이트
- 매일
- 만화도
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