250x250
반응형
Notice
Recent Posts
Recent Comments
Link
목록arranging coins (1)
N
(Leet Code JS)Arranging Coins
https://leetcode.com/problems/arranging-coins/ Arranging Coins - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 계단식으로 코인을 쌓을 때, n 개의 코인이 몇층까지 완벽하게 채워져있는지 확인하는 문제다. sum과 row 두 변수를 이용해서 풀 수 있다. sum은 한 층마다 놓은 코인의 총 합이다. row 층마다 코인을 row 개 놓을 수 있으니, while문을 이용해 sum < n이라면 sum += row를 하..
Leet Code 알고리즘
2022. 5. 13. 15:32