leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

Bug Report for two-integer-sum

Open HIS-MOHAMMED opened this issue 2 months ago • 0 comments

Bug Report for https://neetcode.io/problems/two-integer-sum

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

issue:mAmbiguous phrasing in problem description In the statement: “Return the indices i and j such that nums[i] + nums[j] == target and i != j.”

the condition i != j can cause misunderstanding. Some solvers may interpret it mathematically rather than as a coding restriction, which might make them question valid examples such as:

Example 3: nums = [5,5], target = 10 Output: [0,1]

At first glance, it seems this example violates i != j since both elements have the same value. However, the example is correct — we are using different indices, not the same element twice.

Suggested Fix: Reword the condition to the more standard phrasing used in algorithmic problems:

“You may not use the same element twice.”

This eliminates ambiguity and improves clarity for solvers.

HIS-MOHAMMED avatar Oct 21 '25 07:10 HIS-MOHAMMED