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 a61b451 commit bcd77f6Copy full SHA for bcd77f6
Easy/Missing Number.java
@@ -0,0 +1,6 @@
1
+class Solution {
2
+ public int missingNumber(int[] nums) {
3
+ return (nums.length * (nums.length + 1) / 2) - Arrays.stream(nums).boxed()
4
+ .reduce(0, Integer::sum);
5
+ }
6
+}
Easy/Missing Numbers.java
0 commit comments