C# - complete the square, solve for rows


  • 0
    public int ArrangeCoins(int n) {
        return (int)(Math.Sqrt((double)n * 2.0 + 0.25) - 0.5);
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.