Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 323 Bytes

File metadata and controls

5 lines (3 loc) · 323 Bytes

Use array a to show the position of a number.

For instance, if a[i] === undefined, it means we don't have the number of i in the array, and if not, it means the number of i appears in the position of index === a[i].

So it will be easy, we can enum the array, and check if a[target - item] is undefined or not.