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.
2 parents a4ec1bc + 9751fd5 commit 2c8c2bcCopy full SHA for 2c8c2bc
268.Missing_Number.java
@@ -0,0 +1,10 @@
1
+class Solution {
2
+ public int missingNumber(int[] nums) {
3
+ int n = nums.length;
4
+ int sum = (n * (n+1)) / 2;
5
+ for(int i=0; i<n; i++) {
6
+ sum -= nums[i];
7
+ }
8
+ return sum;
9
10
+}
832.Flipping_an_Image.java
@@ -0,0 +1,15 @@
+ public int[][] flipAndInvertImage(int[][] image) {
+ for(int i=0;i<image.length;i++){
+ int low = 0;
+ int high = image.length-1;
+ while(low<=high){
+ if(image[i][low]==image[i][high])
+ image[i][low]=image[i][high] = 1-image[i][low];
+ low++;
+ high--;
11
12
13
+ return image;
14
15
0 commit comments