티스토리 뷰
반응형

나의코드
class Solution:
def maximumWealth(self, accounts: List[List[int]]) -> int:
array=[]
for i in range(0,len(accounts)):
result = 0
for l in range(0, len(accounts[i]) ):
result += accounts[i][l]
array.append(result)
return max(array)
더 간결한 코드
class Solution:
def maximumWealth(self, accounts: List[List[int]]) -> int:
return max(sum(customer) for customer in accounts)
*유의사항
sum(account for account in accounts) 는 [1,2,3,1,2,3] 이고,
sum(account) for account in accounts 는 각각 6,6
반응형
'LeetCode' 카테고리의 다른 글
[LeetCode/Python] 412. Fizz Buzz (0) | 2025.05.12 |
---|---|
[LeetCode/Python] 1480. Running Sum of 1d Array (0) | 2025.05.10 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- helm
- 함수형프로그래밍
- k8s
- 데이터엔지니어
- airflow
- next.js
- asyncio
- un-supervised
- 메타코드
- supervised
- pscale
- Tailwind
- 대수자료구조
- 부트캠프
- asyncio.gather
- datalabeling
- docker
- 위즈윅에디터
- 타입스크립트
- semi-supervised
- CloudFlare
- 우테코
- 윈도우pscale설치
- 42서울
- kubectl
- Tableau
- Python
- planetscale배포
- create_task
- nextj이미지저장
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함