【leetcode】面试题 16.11. 跳水板
作者:互联网
int* divingBoard(int shorter, int longer, int k, int* returnSize){ int val=longer-shorter,i; *returnSize=0; int* arr=(int*)calloc(k+1,sizeof(int)); if(k==0) return arr; arr[(*returnSize)++]=shorter*k; if(shorter==longer) return arr; for(i=1; i<k+1; i++) arr[(*returnSize)++]=arr[i-1]+val; return arr; }
标签:面试题,return,longer,arr,returnSize,int,16.11,shorter,leetcode 来源: https://www.cnblogs.com/ganxiang/p/14004849.html