Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- leetcode풀기
- 파이썬 릿코드
- 알고리즘풀기
- 코틀린기초
- binary search
- python priority queue
- 릿코드풀이
- LeetCode
- python Leetcode
- 파이썬알고리즘풀기
- 알고리즘풀이
- 파이썬 알고리즘
- 잇츠디모
- 파이썬릿코드풀기
- 파이썬릿코드
- leetcode 풀기
- 파이썬 프로그래머스
- python xor
- 릿코드 파이썬
- leetcode풀이
- python sorted
- 릿코드 풀기
- python zip_longest
- 파이썬알고리즘
- 파이썬 알고리즘 풀기
- 릿코드
- python 알고리즘
- 상가수익률계산기
- python 릿코드
- 릿코드풀기
Archives
- Today
- Total
소프트웨어에 대한 모든 것
LeetCode 풀기 - 441. Arranging Coins 본문
반응형
441. Arranging Coins
제목
문제)
솔루션1)
class Solution:
def arrangeCoins(self, n: int) -> int:
row = 0
while n > 0:
n -= row + 1
row += 1
if n == 0:
return row
elif n < 0:
return row -1
반응형
'알고리즘 > LeetCode' 카테고리의 다른 글
LeetCode 풀기 - 704. Binary Search (0) | 2021.11.10 |
---|---|
LeetCode 풀기 - 890. Find and Replace Pattern (0) | 2021.11.09 |
LeetCode 풀기 - 260. Single Number III (0) | 2021.11.09 |
LeetCode 풀기 - 1732. Find the Highest Altitude (0) | 2021.11.09 |
LeetCode 풀기 - 797. All Paths From Source to Target (0) | 2021.11.08 |
Comments