diff --git a/Submissions/Ishan Srivastava/Container With Most Water/Screenshot.png b/Submissions/Ishan Srivastava/Container With Most Water/Screenshot.png new file mode 100644 index 0000000..eaf5b69 Binary files /dev/null and b/Submissions/Ishan Srivastava/Container With Most Water/Screenshot.png differ diff --git a/Submissions/Ishan Srivastava/Container With Most Water/Solution.java b/Submissions/Ishan Srivastava/Container With Most Water/Solution.java new file mode 100644 index 0000000..6d941b0 --- /dev/null +++ b/Submissions/Ishan Srivastava/Container With Most Water/Solution.java @@ -0,0 +1,18 @@ +class Solution { + public int maxArea(int[] height) { + int vol = 0; + int i=0; + int j = height.length-1; + while(ivol)?v:vol; + if(height[i]>height[j]) + j--; + else + i++; + } + return vol; + } +} \ No newline at end of file diff --git a/Submissions/Ishan Srivastava/Product Of the Array Except Self/Screenshot.png b/Submissions/Ishan Srivastava/Product Of the Array Except Self/Screenshot.png new file mode 100644 index 0000000..a7676ca Binary files /dev/null and b/Submissions/Ishan Srivastava/Product Of the Array Except Self/Screenshot.png differ diff --git a/Submissions/Ishan Srivastava/Product Of the Array Except Self/Solution.java b/Submissions/Ishan Srivastava/Product Of the Array Except Self/Solution.java new file mode 100644 index 0000000..e191b79 --- /dev/null +++ b/Submissions/Ishan Srivastava/Product Of the Array Except Self/Solution.java @@ -0,0 +1,26 @@ +class Solution { + public int[] productExceptSelf(int[] nums) { + int prefix[] = new int[nums.length]; + int suffix[] = new int[nums.length]; + for(int i=0;i-1;i--) + { + suffix[i] = suffix[i+1]*nums[i+1]; + } + + int ans[] = new int[nums.length]; + for(int i=0;i