You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can run below codes on Leetcode, however, in VScode, the codes cannot run.
🐛 Bug Report
##Example1. LC53.maximum-subarray
error message:
53.maximum-subarray.java:11: error: missing return statement } ^ 1 error
Code:
'
class Solution {
public int maxSubArray(int[] nums) {
int res = nums[0];
int sum = nums[0];
for (int i = 1; i < nums.length; i++) {
res = Math.max(res + nums[i], nums[i]);
sum = Math.max(res, sum);
}
return sum;
}
}
'
Error:
##Example2: LC238.product-of-array-except-self
Code:
`
class Solution {
public int[] productExceptSelf(int[] nums) {
int len = nums.length;
int[] res = new int[len];
res[0] = 1;
// int temp = nums[len - 1];
for (int i = 1; i < len; i++) {
res[i] = nums[i - 1] * res[i - 1];
}
int temp = 1;
for (int i = len - 1; i >= 0; i--) {
res[i] *= temp;
temp *= nums[i];
}
//res[0] = temp;
return res;
}
I can run below codes on Leetcode, however, in VScode, the codes cannot run.
🐛 Bug Report
##Example1. LC53.maximum-subarray
error message:
53.maximum-subarray.java:11: error: missing return statement } ^ 1 error
Code:
'
class Solution {
public int maxSubArray(int[] nums) {
int res = nums[0];
int sum = nums[0];
}

'
Error:
##Example2: LC238.product-of-array-except-self

Code: ` class Solution { public int[] productExceptSelf(int[] nums) { int len = nums.length; int[] res = new int[len]; res[0] = 1; // int temp = nums[len - 1];}
`
Your Environment
Version: 1.47.3 (system setup)
Commit: 91899dcef7b8110878ea59626991a18c8a6a1b3e
Date: 2020-07-23T13:12:49.994Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362
Leetcode version: download from vscode extension
Thanks.
The text was updated successfully, but these errors were encountered: