Leetcode in Java && Oracle
419 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-11-10_13-52-56.png
19.9 KB
#N441. Arranging Coins
problem link

#solution
class Solution {
public int arrangeCoins(int n) {
return ((int)(Math.pow((1+8*(long)n), 0.5))-1)/2;
}
}

p.s. Yeah, math really helps to solve this kind of problems😅