Skip to content

Commit 28d12d7

Browse files
author
0x01f7
committed
style: comment
1 parent aef10c1 commit 28d12d7

15 files changed

+24
-24
lines changed

algorithms/course_schedule.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# There are a total of n courses you have to take, labeled from 0 to n - 1.
44
# Some courses may have prerequisites, for example to take course 0 you have
5-
# to first take course 1, which is expressed as a pair: [0,1]. Given the total
5+
# to first take course 1, which is expressed as a pair: [0, 1]. Given the total
66
# number of courses and a list of prerequisite pairs, is it possible for you
77
# to finish all courses?
88
#

algorithms/course_schedule_ii.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# There are a total of n courses you have to take, labeled from 0 to n - 1.
44
# Some courses may have prerequisites, for example to take course 0 you have
5-
# to first take course 1, which is expressed as a pair: [0,1]. Given the total
5+
# to first take course 1, which is expressed as a pair: [0, 1]. Given the total
66
# number of courses and a list of prerequisite pairs, return the ordering of
77
# courses you should take to finish all courses.
88
#

algorithms/first_missing_positive.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# For example:
66
#
7-
# Given [1,2,0] return 3, and [3,4,-1,1] return 2.
7+
# Given [1, 2, 0] return 3, and [3, 4, -1, 1] return 2.
88
#
99
# Your algorithm should run in O(n) time and uses constant space.
1010

algorithms/gray_code.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# number of bits in the code, print the sequence of gray code. A gray code
66
# sequence must begin with 0.
77
#
8-
# For example, given n = 2, return [0,1,3,2]. Its gray code sequence is:
8+
# For example, given n = 2, return [0, 1, 3, 2]. Its gray code sequence is:
99
#
1010
# 00 - 0
1111
# 01 - 1
@@ -15,8 +15,8 @@
1515
# Note:
1616
#
1717
# + For a given n, a gray code sequence is not uniquely defined.
18-
# + For example, [0,2,3,1] is also a valid gray code sequence according to
19-
# the above definition.
18+
# + For example, [0, 2, 3, 1] is also a valid gray code sequence according
19+
# to the above definition.
2020
# + For now, the judge is able to judge based on one instance of gray code
2121
# sequence. Sorry about that.
2222

algorithms/jump_game.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#
88
# For example:
99
#
10-
# A = [2,3,1,1,4], return true.
11-
# A = [3,2,1,0,4], return false.
10+
# A = [2, 3, 1, 1, 4], return true.
11+
# A = [3, 2, 1, 0, 4], return false.
1212

1313

1414
# @param {Integer[]} nums

algorithms/jump_game_ii.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# For example:
99
#
10-
# Given array A = [2,3,1,1,4]
10+
# Given array A = [2, 3, 1, 1, 4]
1111
# The minimum number of jumps to reach the last index is 2. (Jump 1 step
1212
# from index 0 to 1, then 3 steps to the last index.)
1313

algorithms/kth_largest_element_in_an_array.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Find the kth largest element in an unsorted array. Note that it is the kth
44
# largest element in the sorted order, not the kth distinct element.
55
#
6-
# For example, Given [3,2,1,5,6,4] and k = 2, return 5.
6+
# For example, Given [3, 2, 1, 5, 6, 4] and k = 2, return 5.
77
#
88
# Note:
99
#

algorithms/largest_rectangle_in_histogram.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# | | |+-+|+-+| | |
3636
# |___|___|+-+|+-+|___|___|
3737
#
38-
# For example, Given height = [2,1,5,6,2,3], return 10.
38+
# For example, Given height = [2, 1, 5, 6, 2, 3], return 10.
3939

4040

4141
# @param {Integer[]} height

algorithms/maximum_product_subarray.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Find the contiguous subarray within an array (containing at least one number)
44
# which has the largest product.
55
#
6-
# For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has
6+
# For example, given the array [2, 3, -2, 4], the contiguous subarray [2,3] has
77
# the largest product = 6.
88

99

algorithms/minimum_size_subarray_sum.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://leetcode.com/problems/minimum-size-subarray-sum/
22
#
33
# Given an array of n positive integers and a positive integer s, find the
4-
# minimal length of a subarray of which the sum s. If there isn't one,
4+
# minimal length of a subarray of which the sum >= s. If there isn't one,
55
# return 0 instead.
66
#
77
# For example, given the array [2, 3, 1, 2, 4, 3] and s = 7, the subarray

algorithms/next_permutation.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# allocate extra memory. Here are some examples. Inputs are in the left-hand
88
# column and its corresponding outputs are in the right-hand column.
99
#
10-
# 1,2,3 -> 1,3,2
11-
# 3,2,1 -> 1,2,3
12-
# 1,1,5 -> 1,5,1
10+
# 1, 2, 3 -> 1, 3, 2
11+
# 3, 2, 1 -> 1, 2, 3
12+
# 1, 1, 5 -> 1, 5, 1
1313

1414

1515
# @param {Integer[]} nums

algorithms/partition_list.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#
99
# For example:
1010
#
11-
# Given 1->4->3->2->5->2 and x = 3,
12-
# Return 1->2->2->4->3->5.
11+
# Given 1 -> 4 -> 3 -> 2 -> 5 -> 2 and x = 3,
12+
# Return 1 -> 2 -> 2 -> 4 -> 3 -> 5.
1313

1414

1515
# Definition for singly-linked list.

algorithms/pascals_triangle_ii.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Given an index k, return the kth row of the Pascal's triangle.
44
#
5-
# For example, given k = 3, Return [1,3,3,1].
5+
# For example, given k = 3, Return [1, 3, 3, 1].
66
#
77
# Note:
88
#

algorithms/path_sum.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# / \ \
1616
# 7 2 1
1717
#
18-
# Return true, as there exist a root-to-leaf
19-
# path 5->4->11->2 which sum is 22.
18+
# Return true, as there exist a root-to-leaf path 5 -> 4 -> 11 -> 2 which
19+
# sum is 22.
2020

2121

2222
# Definition for a binary tree node.

algorithms/permutation_sequence.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# https://leetcode.com/problems/permutation-sequence/
22
#
3-
# The set [1,2,3,…,n] contains a total of n! unique permutations. By listing
4-
# and labeling all of the permutations in order, We get the following sequence
5-
# (ie, for n = 3):
3+
# The set [1, 2, 3, ..., n] contains a total of n! unique permutations. By
4+
# listing and labeling all of the permutations in order, We get the following
5+
# sequence (ie, for n = 3):
66
#
77
# 1. "123"
88
# 2. "132"

0 commit comments

Comments
 (0)