What is the Time complexity of isPascal() method

后端 未结 0 1537
梦谈多话
梦谈多话 2021-01-23 23:13
static int isPascal(int n) {
    int sum = 0;
    int nthVal = 1;
    while (sum < n) {
        sum = sum + nthVal;
        nthVal++;
    }
    return sum == n ? 1 :          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题