You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: solution/1400-1499/1434.Number of Ways to Wear Different Hats to Each Other/README_EN.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ tags:
25
25
26
26
<p>Given a 2D integer array <code>hats</code>, where <code>hats[i]</code> is a list of all hats preferred by the <code>i<sup>th</sup></code> person.</p>
27
27
28
-
<p>Return <em>the number of ways that the <code>n</code> people wear different hats to each other</em>.</p>
28
+
<p>Return the number of ways that <code>n</code> people can wear <strong>different</strong> hats from each other.</p>
29
29
30
30
<p>Since the answer may be too large, return it modulo <code>10<sup>9</sup> + 7</code>.</p>
Copy file name to clipboardexpand all lines: solution/1400-1499/1471.The k Strongest Values in an Array/README_EN.md
+25-7
Original file line number
Diff line number
Diff line change
@@ -22,25 +22,43 @@ tags:
22
22
23
23
<p>Given an array of integers <code>arr</code> and an integer <code>k</code>.</p>
24
24
25
-
<p>A value <code>arr[i]</code> is said to be stronger than a value <code>arr[j]</code> if <code>|arr[i] - m| > |arr[j] - m|</code> where <code>m</code> is the <strong>median</strong> of the array.<br />
25
+
<p>A value <code>arr[i]</code> is said to be stronger than a value <code>arr[j]</code> if <code>|arr[i] - m| > |arr[j] - m|</code> where <code>m</code> is the <strong>centre</strong> of the array.<br />
26
26
If <code>|arr[i] - m| == |arr[j] - m|</code>, then <code>arr[i]</code> is said to be stronger than <code>arr[j]</code> if <code>arr[i]> arr[j]</code>.</p>
27
27
28
28
<p>Return <em>a list of the strongest <code>k</code></em> values in the array. return the answer <strong>in any arbitrary order</strong>.</p>
29
29
30
-
<p><strong>Median</strong> is the middle value in an ordered integer list. More formally, if the length of the list is n, the median is the element in position <code>((n - 1) / 2)</code> in the sorted list <strong>(0-indexed)</strong>.</p>
30
+
<p>The <strong>centre</strong> is the middle value in an ordered integer list. More formally, if the length of the list is n, the centre is the element in position <code>((n - 1) / 2)</code> in the sorted list <strong>(0-indexed)</strong>.</p>
31
31
32
32
<ul>
33
-
<li>For <code>arr = [6, -3, 7, 2, 11]</code>, <code>n = 5</code> and the median is obtained by sorting the array <code>arr = [-3, 2, 6, 7, 11]</code> and the median is <code>arr[m]</code> where <code>m = ((5 - 1) / 2) = 2</code>. The median is <code>6</code>.</li>
34
-
<li>For <code>arr = [-7, 22, 17, 3]</code>, <code>n = 4</code> and the median is obtained by sorting the array <code>arr = [-7, 3, 17, 22]</code> and the median is <code>arr[m]</code> where <code>m = ((4 - 1) / 2) = 1</code>. The median is <code>3</code>.</li>
33
+
<li>For <code>arr = [6, -3, 7, 2, 11]</code>, <code>n = 5</code> and the centre is obtained by sorting the array <code>arr = [-3, 2, 6, 7, 11]</code> and the centre is <code>arr[m]</code> where <code>m = ((5 - 1) / 2) = 2</code>. The centre is <code>6</code>.</li>
34
+
<li>For <code>arr = [-7, 22, 17, 3]</code>, <code>n = 4</code> and the centre is obtained by sorting the array <code>arr = [-7, 3, 17, 22]</code> and the centre is <code>arr[m]</code> where <code>m = ((4 - 1) / 2) = 1</code>. The centre is <code>3</code>.</li>
<strong>Explanation:</strong> Median is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also <strong>accepted</strong> answer.
61
+
<strong>Explanation:</strong> Centre is 3, the elements of the array sorted by the strongest are [5,1,4,2,3]. The strongest 2 elements are [5, 1]. [1, 5] is also <strong>accepted</strong> answer.
44
62
Please note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5 > 1.
45
63
</pre>
46
64
@@ -49,15 +67,15 @@ Please note that although |5 - 3| == |1 - 3| but 5 is stronger than 1 because 5
49
67
<pre>
50
68
<strong>Input:</strong> arr = [1,1,3,5,5], k = 2
51
69
<strong>Output:</strong> [5,5]
52
-
<strong>Explanation:</strong> Median is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].
70
+
<strong>Explanation:</strong> Centre is 3, the elements of the array sorted by the strongest are [5,5,1,1,3]. The strongest 2 elements are [5, 5].
53
71
</pre>
54
72
55
73
<p><strongclass="example">Example 3:</strong></p>
56
74
57
75
<pre>
58
76
<strong>Input:</strong> arr = [6,7,11,7,6,8], k = 5
59
77
<strong>Output:</strong> [11,8,6,6,7]
60
-
<strong>Explanation:</strong> Median is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].
78
+
<strong>Explanation:</strong> Centre is 7, the elements of the array sorted by the strongest are [11,8,6,6,7,7].
61
79
Any permutation of [11,8,6,6,7] is <strong>accepted</strong>.
Copy file name to clipboardexpand all lines: solution/2100-2199/2138.Divide a String Into Groups of Size k/README_EN.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ tags:
22
22
<p>A string <code>s</code> can be partitioned into groups of size <code>k</code> using the following procedure:</p>
23
23
24
24
<ul>
25
-
<li>The first group consists of the first <code>k</code> characters of the string, the second group consists of the next <code>k</code> characters of the string, and so on. Each character can be a part of <strong>exactly one</strong> group.</li>
25
+
<li>The first group consists of the first <code>k</code> characters of the string, the second group consists of the next <code>k</code> characters of the string, and so on. Each element can be a part of <strong>exactly one</strong> group.</li>
26
26
<li>For the last group, if the string <strong>does not</strong> have <code>k</code> characters remaining, a character <code>fill</code> is used to complete the group.</li>
Copy file name to clipboardexpand all lines: solution/2500-2599/2562.Find the Array Concatenation Value/README_EN.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,11 @@ tags:
31
31
<p>The <strong>concatenation value</strong> of <code>nums</code> is initially equal to <code>0</code>. Perform this operation until <code>nums</code> becomes empty:</p>
32
32
33
33
<ul>
34
-
<li>If there exists more than one number in <code>nums</code>, pick the first element and last element in <code>nums</code> respectively and add the value of their concatenation to the <strong>concatenation value</strong> of <code>nums</code>, then delete the first and last element from <code>nums</code>.</li>
35
-
<li>If one element exists, add its value to the <strong>concatenation value</strong> of <code>nums</code>, then delete it.</li>
34
+
<li>If <code>nums</code> has a size greater than one, add the value of the concatenation of the first and the last element to the <strong>concatenation value</strong> of <code>nums</code>, and remove those two elements from <code>nums</code>. For example, if the <code>nums</code> was <code>[1, 2, 4, 5, 6]</code>, add 16 to the <code>concatenation value</code>.</li>
35
+
<li>If only one element exists in <code>nums</code>, add its value to the <strong>concatenation value</strong> of <code>nums</code>, then remove it.</li>
36
36
</ul>
37
37
38
-
<p>Return<em> the concatenation value of the <code>nums</code></em>.</p>
38
+
<p>Return<em> the concatenation value of <code>nums</code></em>.</p>
Copy file name to clipboardexpand all lines: solution/2700-2799/2701.Consecutive Transactions with Increasing Amounts/README_EN.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Each row contains information about transactions that includes unique (customer_
33
33
34
34
<p>Write an SQL query to find the customers who have made consecutive transactions with increasing <code>amount</code> for at least three consecutive days. Include the <code>customer_id</code>, start date of the consecutive transactions period and the end date of the consecutive transactions period. There can be multiple consecutive transactions by a customer.</p>
35
35
36
-
<p>Return <em>the result table ordered by</em> <code>customer_id</code> <em>in <strong>ascending</strong> order.</em></p>
Copy file name to clipboardexpand all lines: solution/2900-2999/2965.Find Missing and Repeated Values/README_EN.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ tags:
50
50
<li><code>1 <= grid[i][j] <= n * n</code></li>
51
51
<li>For all <code>x</code> that <code>1 <= x <= n * n</code> there is exactly one <code>x</code> that is not equal to any of the grid members.</li>
52
52
<li>For all <code>x</code> that <code>1 <= x <= n * n</code> there is exactly one <code>x</code> that is equal to exactly two of the grid members.</li>
53
-
<li>For all <code>x</code> that <code>1 <= x <= n * n</code> except two of them there is exatly one pair of <code>i, j</code> that <code>0 <= i, j <= n - 1</code> and <code>grid[i][j] == x</code>.</li>
53
+
<li>For all <code>x</code> that <code>1 <= x <= n * n</code> except two of them there is exactly one pair of <code>i, j</code> that <code>0 <= i, j <= n - 1</code> and <code>grid[i][j] == x</code>.</li>
0 commit comments