Skip to content

Commit 24d69d9

Browse files
add comment for 238
1 parent 440ebfb commit 24d69d9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • src/main/java/com/fishercoder/solutions/firstthousand

src/main/java/com/fishercoder/solutions/firstthousand/_238.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
public class _238 {
44

55
public static class Solution1 {
6+
/**
7+
* Have two arrays to help out: one array holds all the products of elements to the left of
8+
* nums[i] the 2nd array holds all the products of elements to the right of nums[i[ then
9+
* multiply them together.
10+
*/
611
public int[] productExceptSelf(int[] nums) {
712
int[] left = new int[nums.length];
813
left[0] = 1;

0 commit comments

Comments
 (0)