Skip to content

Commit 15d8fb7

Browse files
author
0x01f7
committed
style: comment
1 parent 180b141 commit 15d8fb7

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

algorithms/3sum.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# https://leetcode.com/problems/3sum/
22
#
3-
# Given an array S of n integers, are there elements a, b, c
4-
# in S such that a + b + c = 0? Find all unique triplets in
5-
# the array which gives the sum of zero.
3+
# Given an array S of n integers, are there elements a, b, c in S such that
4+
# a + b + c = 0? Find all unique triplets in the array which gives the sum
5+
# of zero.
66
#
77
# Notes:
88
#
9-
# + Elements in a triplet (a,b,c) must be in non-descending
10-
# order. (ie, a b c)
9+
# + Elements in a triplet (a, b, c) must be in non-descending order.
10+
# (ie, a <= b <= c)
1111
# + The solution set must not contain duplicate triplets.
1212
#
13-
# For example, given array S = {-1 0 1 2 -1 -4}, A solution set
14-
# is: (-1, 0, 1) (-1, -1, 2)
13+
# For example, given array S = {-1 0 1 2 -1 -4}, A solution set is:
14+
#
15+
# (-1, 0, 1)
16+
# (-1, -1, 2)
1517

1618

1719
# @param {Integer[]} nums

algorithms/3sum_closest.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# https://leetcode.com/problems/3sum-closest/
22
#
3-
# Given an array S of n integers, find three integers in S such
4-
# that the sum is closest to a given number, target. Return the
5-
# sum of the three integers. You may assume that each input
6-
# would have exactly one solution.
3+
# Given an array S of n integers, find three integers in S such that the sum
4+
# is closest to a given number, target. Return the sum of the three integers.
5+
# You may assume that each input would have exactly one solution.
76
#
8-
# For example, given array S = {-1 2 1 -4}, and target = 1. The
9-
# sum that is closest to the target is 2. (-1 + 2 + 1 = 2).
7+
# For example, given array S = {-1 2 1 -4}, and target = 1. The sum that is
8+
# closest to the target is 2. (-1 + 2 + 1 = 2).
109

1110

1211
# @param {Integer[]} nums

algorithms/4sum.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# https://leetcode.com/problems/4sum/
22
#
3-
# Given an array S of n integers, are there elements a, b, c, and d in S
4-
# such that a + b + c + d = target? Find all unique quadruplets in the
5-
# array which gives the sum of target.
3+
# Given an array S of n integers, are there elements a, b, c, and d in S such
4+
# that a + b + c + d = target? Find all unique quadruplets in the array which
5+
# gives the sum of target.
66
#
7-
# Note:
7+
# Notes:
88
#
9-
# + Elements in a quadruplet (a,b,c,d) must be in non-descending
10-
# order. (ie, a b c d)
9+
# + Elements in a quadruplet (a, b, c, d) must be in non-descending order.
10+
# (ie, a <= b <= c <= d)
1111
# + The solution set must not contain duplicate quadruplets.
1212
#
13-
# For example, given array S = {1 0 -1 0 -2 2}, and target = 0. A solution
14-
# set is:
13+
# For example, given array S = {1 0 -1 0 -2 2}, and target = 0. A solution set
14+
# is:
1515
#
1616
# (-1, 0, 0, 1)
1717
# (-2, -1, 1, 2)

0 commit comments

Comments
 (0)