Skip to content

Commit 3bf2129

Browse files
committed
style: update problems description
1 parent b448e2f commit 3bf2129

File tree

280 files changed

+1
-1250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+1
-1250
lines changed

.github/workflows/prettier.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: Prettier
22

33
on:
4-
pull_request:
54
push:
6-
branches:
7-
- main
5+
branches: [ main ]
86

97
jobs:
108
prettier:

solution/0000-0099/0008.String to Integer (atoi)/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
<p><strong>Note:</strong></p>
1818

1919
<ul>
20-
2120
<li>Only the space character <code>&#39; &#39;</code> is considered as whitespace character.</li>
22-
2321
<li>Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [&minus;2<sup>31</sup>,&nbsp; 2<sup>31&nbsp;</sup>&minus; 1]. If the numerical value is out of the range of representable values, INT_MAX (2<sup>31&nbsp;</sup>&minus; 1) or INT_MIN (&minus;2<sup>31</sup>) is returned.</li>
24-
2522
</ul>
2623

2724
<p><strong>Example 1:</strong></p>

solution/0000-0099/0012.Integer to Roman/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@ M 1000</pre>
2929
<p>Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not <code>IIII</code>. Instead, the number four is written as <code>IV</code>. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as <code>IX</code>. There are six instances where subtraction is used:</p>
3030

3131
<ul>
32-
3332
<li><code>I</code> can be placed before <code>V</code> (5) and <code>X</code> (10) to make 4 and 9.&nbsp;</li>
34-
3533
<li><code>X</code> can be placed before <code>L</code> (50) and <code>C</code> (100) to make 40 and 90.&nbsp;</li>
36-
3734
<li><code>C</code> can be placed before <code>D</code> (500) and <code>M</code> (1000) to make 400 and 900.</li>
38-
3935
</ul>
4036

4137
<p>Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999.</p>

solution/0000-0099/0013.Roman to Integer/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@ M 1000</pre>
2929
<p>Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not <code>IIII</code>. Instead, the number four is written as <code>IV</code>. Because the one is before the five we subtract it making four. The same principle applies to the number nine, which is written as <code>IX</code>. There are six instances where subtraction is used:</p>
3030

3131
<ul>
32-
3332
<li><code>I</code> can be placed before <code>V</code> (5) and <code>X</code> (10) to make 4 and 9.&nbsp;</li>
34-
3533
<li><code>X</code> can be placed before <code>L</code> (50) and <code>C</code> (100) to make 40 and 90.&nbsp;</li>
36-
3734
<li><code>C</code> can be placed before <code>D</code> (500) and <code>M</code> (1000) to make 400 and 900.</li>
38-
3935
</ul>
4036

4137
<p>Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.</p>

solution/0000-0099/0025.Reverse Nodes in k-Group/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@
2323
<p><strong>Note:</strong></p>
2424

2525
<ul>
26-
2726
<li>Only constant extra memory is allowed.</li>
28-
2927
<li>You may not alter the values in the list&#39;s nodes, only nodes itself may be changed.</li>
30-
3128
</ul>
3229

3330
## Solutions

solution/0000-0099/0036.Valid Sudoku/README_EN.md

-5
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,10 @@
9393
<p><strong>Note:</strong></p>
9494

9595
<ul>
96-
9796
<li>A Sudoku board (partially filled) could be valid but is not necessarily solvable.</li>
98-
9997
<li>Only the filled cells need to be validated according to the mentioned&nbsp;rules.</li>
100-
10198
<li>The given board&nbsp;contain only digits <code>1-9</code> and the character <code>&#39;.&#39;</code>.</li>
102-
10399
<li>The given board size is always <code>9x9</code>.</li>
104-
105100
</ul>
106101

107102
## Solutions

solution/0000-0099/0037.Sudoku Solver/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@
3131
<p><strong>Note:</strong></p>
3232

3333
<ul>
34-
3534
<li>The given board&nbsp;contain only digits <code>1-9</code> and the character <code>&#39;.&#39;</code>.</li>
36-
3735
<li>You may assume that the given Sudoku puzzle will have a single unique solution.</li>
38-
3936
<li>The given board size is always <code>9x9</code>.</li>
40-
4137
</ul>
4238

4339
## Solutions

solution/0000-0099/0039.Combination Sum/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
<p><strong>Note:</strong></p>
1212

1313
<ul>
14-
1514
<li>All numbers (including <code>target</code>) will be positive integers.</li>
16-
1715
<li>The solution set must not contain duplicate combinations.</li>
18-
1916
</ul>
2017

2118
<p><strong>Example 1:</strong></p>

solution/0000-0099/0040.Combination Sum II/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
<p><strong>Note:</strong></p>
1212

1313
<ul>
14-
1514
<li>All numbers (including <code>target</code>) will be positive integers.</li>
16-
1715
<li>The solution set must not contain duplicate combinations.</li>
18-
1916
</ul>
2017

2118
<p><strong>Example 1:</strong></p>

solution/0000-0099/0044.Wildcard Matching/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
<p><strong>Note:</strong></p>
2020

2121
<ul>
22-
2322
<li><code>s</code>&nbsp;could be empty and contains only lowercase letters <code>a-z</code>.</li>
24-
2523
<li><code>p</code> could be empty and contains only lowercase letters <code>a-z</code>, and characters like <code><font face="monospace">?</font></code>&nbsp;or&nbsp;<code>*</code>.</li>
26-
2724
</ul>
2825

2926
<p><strong>Example 1:</strong></p>

solution/0000-0099/0049.Group Anagrams/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@
2727
<p><strong>Note:</strong></p>
2828

2929
<ul>
30-
3130
<li>All inputs will be in lowercase.</li>
32-
3331
<li>The order of your output does not&nbsp;matter.</li>
34-
3532
</ul>
3633

3734
## Solutions

solution/0000-0099/0050.Pow(x, n)/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@
4141
<p><strong>Note:</strong></p>
4242

4343
<ul>
44-
4544
<li>-100.0 &lt; <em>x</em> &lt; 100.0</li>
46-
4745
<li><em>n</em> is a 32-bit signed integer, within the range&nbsp;[&minus;2<sup>31</sup>,&nbsp;2<sup>31&nbsp;</sup>&minus; 1]</li>
48-
4946
</ul>
5047

5148
## Solutions

solution/0000-0099/0060.Permutation Sequence/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@
2929
<p><strong>Note:</strong></p>
3030

3131
<ul>
32-
3332
<li>Given <em>n</em> will be between 1 and 9 inclusive.</li>
34-
3533
<li>Given&nbsp;<em>k</em>&nbsp;will be between 1 and <em>n</em>! inclusive.</li>
36-
3734
</ul>
3835

3936
<p><strong>Example 1:</strong></p>

solution/0000-0099/0065.Valid Number/README_EN.md

-5
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,10 @@
3939
<p><strong>Note:</strong> It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one. However, here is a list of characters that can be in a valid decimal number:</p>
4040

4141
<ul>
42-
4342
<li>Numbers 0-9</li>
44-
4543
<li>Exponent - &quot;e&quot;</li>
46-
4744
<li>Positive/negative sign - &quot;+&quot;/&quot;-&quot;</li>
48-
4945
<li>Decimal point - &quot;.&quot;</li>
50-
5146
</ul>
5247

5348
<p>Of course, the context of these characters also matters in the input.</p>

solution/0000-0099/0068.Text Justification/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@
1515
<p><strong>Note:</strong></p>
1616

1717
<ul>
18-
1918
<li>A word is defined as a character sequence consisting&nbsp;of non-space characters only.</li>
20-
2119
<li>Each word&#39;s length is&nbsp;guaranteed to be greater than 0 and not exceed <em>maxWidth</em>.</li>
22-
2320
<li>The input array <code>words</code>&nbsp;contains at least one word.</li>
24-
2521
</ul>
2622

2723
<p><strong>Example 1:</strong></p>

solution/0000-0099/0073.Set Matrix Zeroes/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,9 @@
6969
<p><strong>Follow up:</strong></p>
7070

7171
<ul>
72-
7372
<li>A straight forward solution using O(<em>m</em><em>n</em>) space is probably a bad idea.</li>
74-
7573
<li>A simple improvement uses O(<em>m</em> + <em>n</em>) space, but still not the best solution.</li>
76-
7774
<li>Could you devise a constant space solution?</li>
78-
7975
</ul>
8076

8177
## Solutions

solution/0000-0099/0074.Search a 2D Matrix/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
<p>Write an efficient algorithm that searches for a value in an <em>m</em> x <em>n</em> matrix. This matrix has the following properties:</p>
88

99
<ul>
10-
1110
<li>Integers in each row are sorted from left to right.</li>
12-
1311
<li>The first integer of each row is greater than the last integer of the previous row.</li>
14-
1512
</ul>
1613

1714
<p><strong>Example 1:</strong></p>

solution/0000-0099/0075.Sort Colors/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@
2121
<p><strong>Follow up:</strong></p>
2222

2323
<ul>
24-
2524
<li>A rather straight forward solution is a two-pass algorithm using counting sort.<br />
26-
2725
First, iterate the array counting number of 0&#39;s, 1&#39;s, and 2&#39;s, then overwrite array with total number of 0&#39;s, then 1&#39;s and followed by 2&#39;s.</li>
28-
2926
<li>Could you come up with a&nbsp;one-pass algorithm using only constant space?</li>
30-
3127
</ul>
3228

3329
## Solutions

solution/0000-0099/0076.Minimum Window Substring/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
<p><strong>Note:</strong></p>
2020

2121
<ul>
22-
2322
<li>If there is no such window in S that covers all characters in T, return the empty string <code>&quot;&quot;</code>.</li>
24-
2523
<li>If there is such window, you are guaranteed that there will always be only one unique minimum window in S.</li>
26-
2724
</ul>
2825

2926
## Solutions

solution/0000-0099/0081.Search in Rotated Sorted Array II/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@
3131
<p><strong>Follow up:</strong></p>
3232

3333
<ul>
34-
3534
<li>This is a follow up problem to&nbsp;<a href="/problems/search-in-rotated-sorted-array/description/">Search in Rotated Sorted Array</a>, where <code>nums</code> may contain duplicates.</li>
36-
3735
<li>Would this affect the run-time complexity? How and why?</li>
38-
3936
</ul>
4037

4138
## Solutions

solution/0000-0099/0088.Merge Sorted Array/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
<p><strong>Note:</strong></p>
1010

1111
<ul>
12-
1312
<li>The number of elements initialized in <em>nums1</em> and <em>nums2</em> are <em>m</em> and <em>n</em> respectively.</li>
14-
1513
<li>You may assume that <em>nums1</em> has enough space (size that is greater or equal to <em>m</em> + <em>n</em>) to hold additional elements from <em>nums2</em>.</li>
16-
1714
</ul>
1815

1916
<p><strong>Example:</strong></p>

solution/0000-0099/0098.Validate Binary Search Tree/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99
<p>Assume a BST is defined as follows:</p>
1010

1111
<ul>
12-
1312
<li>The left subtree of a node contains only nodes with keys <strong>less than</strong> the node&#39;s key.</li>
14-
1513
<li>The right subtree of a node contains only nodes with keys <strong>greater than</strong> the node&#39;s key.</li>
16-
1714
<li>Both the left and right subtrees must also be binary search trees.</li>
18-
1915
</ul>
2016

2117
<p>&nbsp;</p>

solution/0000-0099/0099.Recover Binary Search Tree/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,8 @@
8383
<p><strong>Follow up:</strong></p>
8484

8585
<ul>
86-
8786
<li>A solution using O(<em>n</em>) space is pretty straight forward.</li>
88-
8987
<li>Could you devise a constant space solution?</li>
90-
9188
</ul>
9289

9390
## Solutions

solution/0100-0199/0126.Word Ladder II/README_EN.md

-9
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,18 @@
77
<p>Given two words (<em>beginWord</em> and <em>endWord</em>), and a dictionary&#39;s word list, find all shortest transformation sequence(s) from <em>beginWord</em> to <em>endWord</em>, such that:</p>
88

99
<ol>
10-
1110
<li>Only one letter can be changed at a time</li>
12-
1311
<li>Each transformed word must exist in the word list. Note that <em>beginWord</em> is <em>not</em> a transformed word.</li>
14-
1512
</ol>
1613

1714
<p><strong>Note:</strong></p>
1815

1916
<ul>
20-
2117
<li>Return an empty list if there is no such transformation sequence.</li>
22-
2318
<li>All words have the same length.</li>
24-
2519
<li>All words contain only lowercase alphabetic characters.</li>
26-
2720
<li>You may assume no duplicates in the word list.</li>
28-
2921
<li>You may assume <em>beginWord</em> and <em>endWord</em> are non-empty and are not the same.</li>
30-
3122
</ul>
3223

3324
<p><strong>Example 1:</strong></p>

solution/0100-0199/0134.Gas Station/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313
<p><strong>Note:</strong></p>
1414

1515
<ul>
16-
1716
<li>If there exists a&nbsp;solution, it is guaranteed to be unique.</li>
18-
1917
<li>Both input arrays are non-empty and have the same length.</li>
20-
2118
<li>Each element in the input arrays is a non-negative integer.</li>
22-
2319
</ul>
2420

2521
<p><strong>Example 1:</strong></p>

solution/0100-0199/0135.Candy/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
<p>You are giving candies to these children subjected to the following requirements:</p>
1010

1111
<ul>
12-
1312
<li>Each child must have at least one candy.</li>
14-
1513
<li>Children with a higher rating get more candies than their neighbors.</li>
16-
1714
</ul>
1815

1916
<p>What is the minimum candies you must give?</p>

solution/0100-0199/0140.Word Break II/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99
<p><strong>Note:</strong></p>
1010

1111
<ul>
12-
1312
<li>The same word in the dictionary may be reused multiple times in the segmentation.</li>
14-
1513
<li>You may assume the dictionary does not contain duplicate words.</li>
16-
1714
</ul>
1815

1916
<p><strong>Example 1:</strong></p>

solution/0100-0199/0147.Insertion Sort List/README_EN.md

-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@ With each iteration one element (red) is removed from the input data and inserte
2525
<p><strong>Algorithm of Insertion Sort:</strong></p>
2626

2727
<ol>
28-
2928
<li>Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list.</li>
30-
3129
<li>At each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, and inserts it there.</li>
32-
3330
<li>It repeats until no input elements remain.</li>
34-
3531
</ol>
3632

3733
<p><br />

solution/0100-0199/0150.Evaluate Reverse Polish Notation/README_EN.md

-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
<p><strong>Note:</strong></p>
1212

1313
<ul>
14-
1514
<li>Division between two integers should truncate toward zero.</li>
16-
1715
<li>The given RPN expression is always valid. That means the expression would always evaluate to a result and there won&#39;t&nbsp;be any&nbsp;divide&nbsp;by zero operation.</li>
18-
1916
</ul>
2017

2118
<p><strong>Example 1:</strong></p>

0 commit comments

Comments
 (0)