Skip to content

LeetcodeTest always return Wrong Answer #66

Open
@qwss12345

Description

@qwss12345

the answer is :
class Solution {
public:
vector twoSum(vector& nums, int target) {
for(int i = 0; i < nums.size()-1; i++) {
for(int j = i+1; j< nums.size(); j++) {
if(nums[i] + nums[j] == target) {
return {i, j};
}
}
}
return {};
}
};
Screen Shot 2021-04-06 at 9 03 04 AM

but submit can be accepted.
Screen Shot 2021-04-06 at 9 07 49 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions