Skip to content

Commit 173070a

Browse files
committed
UPDATE (2016/2/13): The return format had been changed to zero-based indices. Please read the above updated description carefully.
1 parent 0b466e1 commit 173070a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

C++/chapLinearList.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ \subsubsection{代码}
501501
for (int i = 0; i < nums.size(); i++) {
502502
const int gap = target - nums[i];
503503
if (mapping.find(gap) != mapping.end() && mapping[gap] > i) {
504-
result.push_back(i + 1);
505-
result.push_back(mapping[gap] + 1);
504+
result.push_back(i);
505+
result.push_back(mapping[gap]);
506506
break;
507507
}
508508
}

C++/leetcode-cpp.pdf

37.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)