当前位置: 首页 > 工具软件 > diving > 使用案例 >

面试题 16.11. Diving Board LCCI

燕玉堂
2023-12-01

https://leetcode-cn.com/problems/diving-board-lcci/

[bug]

class Solution {
    public int[] divingBoard(int shorter, int longer, int k) {

        int[] ret = new int[k+1];
        int i = 0;
        int k1 = k;
        int k2 = 0;
        while(i<k+1){
            ret[i] = shorter*k1 + longer*k2;
            k1--;
            k2++;
        }
        return ret;
    }

}```

 类似资料: