We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 882870c commit e012d19Copy full SHA for e012d19
solution/0200-0299/0238.Product of Array Except Self/README_EN.md
@@ -267,3 +267,15 @@ function productExceptSelf(nums: number[]): number[] {
267
<!-- solution:end -->
268
269
<!-- problem:end -->
270
+
271
+#### Java
272
273
+```java
274
+class Solution {
275
+ public int[] productExceptSelf(int[] nums) {
276
+ return IntStream.range(0, nums.length)
277
+ .map(i -> IntStream.range(0, nums.length)
278
+ .reduce(1, (p, j) -> j == i ? p : p * nums[j]))
279
+ .toArray();
280
+ }
281
+}
0 commit comments