Skip to content

Commit 0d9b187

Browse files
authored
Fixed example for 1-based indexing
Fixing the provided example for Julia's 1-based indexing
1 parent b60c754 commit 0d9b187

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/problems/1.two-sum.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# ---
1111
#
1212
# Given an array of integers `nums` and an integer `target`, return _indices of
13-
# the two numbers such that they add up to`target`_.
13+
# the two numbers so that they add up to `target`_.
1414
#
1515
# You may assume that each input would have **_exactly_ one solution**, and you
1616
# may not use the _same_ element twice.
@@ -24,31 +24,31 @@
2424
#
2525
#
2626
# Input: nums = [2,7,11,15], target = 9
27-
# Output: [0,1]
28-
# Output: Because nums[0] + nums[1] == 9, we return [0, 1].
27+
# Output: [1, 2]
28+
# Output: Because nums[1] + nums[2] == 9, we return [1, 2].
2929
#
3030
#
3131
# **Example 2:**
3232
#
3333
#
3434
#
3535
# Input: nums = [3,2,4], target = 6
36-
# Output: [1,2]
36+
# Output: [2, 3]
3737
#
3838
#
3939
# **Example 3:**
4040
#
4141
#
4242
#
4343
# Input: nums = [3,3], target = 6
44-
# Output: [0,1]
44+
# Output: [1, 2]
4545
#
4646
#
4747
#
4848
#
4949
# **Constraints:**
5050
#
51-
# * `2 <= nums.length <= 103`
51+
# * `2 <= length(nums) <= 103`
5252
# * `-109 <= nums[i] <= 109`
5353
# * `-109 <= target <= 109`
5454
# * **Only one valid answer exists.**

0 commit comments

Comments
 (0)