[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/arjunmullick/Interview/master/ProductArrayExceptSelf.java [Back]  [Original]

package com.leetcode;

public class ProductArrayExceptSelf {

    //https://leetcode.com/problems/product-of-array-except-self/
    class Solution {
        public int[] productExceptSelf(int[] nums) {

            int n = nums.length;
            if(n = 0 ; i--){
                R[i] = R[i+1]* nums[i+1];
            }

            int result[] = new int[n];
            for(int i = 0 ; i < n ; i++){
                result[i] = L[i] * R[i];
            }

            return result;
        }
    }

}

Web Proxy Viewer  |  New URL  |  Original Page