I'm very new to this java language and practicing to build my basics. So here is the code and also the error please tell me how to resolve this
class Solution {
public int[] twoSum(int[] nums, int target) {
for(int i = 0; i < nums.length; i++){
for(int j = 0; j < nums.length; j++){
if(nums[i] + nums[j] == target){
return int[]{i, j};
}
}
}
return ;
}
}
Line 10: error: '.class' expected
return int[]{i, j};
^
Line 10: error: not a statement
return int[]{i, j};
^
Line 10: error: ';' expected
return int[]{i, j};
^
Line 10: error: not a statement
return int[]{i, j};
^
Line 10: error: ';' expected
return int[]{i, j};
^
5 errors