/** * Note: The returned array must be malloced, assume caller calls free(). */ int* productExceptSelf(int* nums, int numsSize, int* returnSize) { //除自身的乘积的的值 等于 左乘积 * 右乘积 int leftPro[numsSize]; int rightPro[numsSize];
//左乘积 leftPro[0] = 1; for(int i = 1; i < numsSize; i++) { leftPro[i] = leftPro[i-1] * nums[i-1]; }
My personal blog is a lively corner where I document my journey of self-improvement, continuous learning, and share the highs and lows of my life's adventures. It's a digital diary where I enthusiastically capture the steps I take to better myself, the invaluable lessons I've learned, and a platform to express my thoughts and experiences.