【leetcode】441. 排列硬币

 

int arrangeCoins(int n){
    int i;
    for(i=1; n>=0; i++)
        n-=i;
    return i-2;
}

 

posted @ 2020-12-02 09:21  温暖了寂寞  阅读(72)  评论(0编辑  收藏  举报