Skip to content

Commit f9c619a

Browse files
committed
08-27
1 parent 51f28dd commit f9c619a

File tree

2,611 files changed

+15
-14657
lines changed

Some content is hidden

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

2,611 files changed

+15
-14657
lines changed

copy.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,36 @@
22
import shutil
33

44
# Assign directory
5-
directory = r"./"
5+
directory = r"./problems"
66
destination = r"./final/"
77

88
# Iterate over files in directory
9+
count = 0
10+
list = []
911
for folder in os.listdir(directory):
1012
print("!folder " + folder)
1113
# Open file
12-
for name in os.listdir(folder):
13-
print("name " + name)
14+
newfolder = "./problems/" + folder
15+
print("!newfolder " + newfolder)
16+
for name in os.listdir(newfolder):
17+
# print("name " + name)
1418
filename = os.path.join(folder, "README.md")
15-
print("filename " + filename)
19+
# print("filename " + filename)
1620
if os.path.exists(filename) is True:
1721
with open(filename) as f:
18-
print(f"Content of '{name}'")
22+
#print(f"Content of '{name}'")
1923
# Read content of file
2024
#print(f.read())
2125
newfilename = destination + folder + '.html'
2226
shutil.copyfile(filename, newfilename)
23-
print("True")
27+
#print("True")
28+
count = count + 1
2429

2530
else:
31+
2632
newfilename = destination + folder + '.html'
2733
with open(newfilename, 'w') as fp:
2834
pass
29-
30-
print()
35+
list.append(newfilename)
36+
37+
print("count ", count)

final/0001-two-sum.html

Whitespace-only changes.

final/0002-add-two-numbers.html

Whitespace-only changes.
Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +0,0 @@
1-
<h2><a href="https://leetcode.com/problems/longest-substring-without-repeating-characters/">3. Longest Substring Without Repeating Characters</a></h2><h3>Medium</h3><hr><div><p>Given a string <code>s</code>, find the length of the <strong>longest</strong> <span data-keyword="substring-nonempty"><strong>substring</strong></span> without repeating characters.</p>
2-
3-
<p>&nbsp;</p>
4-
<p><strong class="example">Example 1:</strong></p>
5-
6-
<pre><strong>Input:</strong> s = "abcabcbb"
7-
<strong>Output:</strong> 3
8-
<strong>Explanation:</strong> The answer is "abc", with the length of 3.
9-
</pre>
10-
11-
<p><strong class="example">Example 2:</strong></p>
12-
13-
<pre><strong>Input:</strong> s = "bbbbb"
14-
<strong>Output:</strong> 1
15-
<strong>Explanation:</strong> The answer is "b", with the length of 1.
16-
</pre>
17-
18-
<p><strong class="example">Example 3:</strong></p>
19-
20-
<pre><strong>Input:</strong> s = "pwwkew"
21-
<strong>Output:</strong> 3
22-
<strong>Explanation:</strong> The answer is "wke", with the length of 3.
23-
Notice that the answer must be a substring, "pwke" is a subsequence and not a substring.
24-
</pre>
25-
26-
<p>&nbsp;</p>
27-
<p><strong>Constraints:</strong></p>
28-
29-
<ul>
30-
<li><code>0 &lt;= s.length &lt;= 5 * 10<sup>4</sup></code></li>
31-
<li><code>s</code> consists of English letters, digits, symbols and spaces.</li>
32-
</ul>
33-
</div>
Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +0,0 @@
1-
<h2><a href="https://leetcode.com/problems/median-of-two-sorted-arrays/">4. Median of Two Sorted Arrays</a></h2><h3>Hard</h3><hr><div><p>Given two sorted arrays <code>nums1</code> and <code>nums2</code> of size <code>m</code> and <code>n</code> respectively, return <strong>the median</strong> of the two sorted arrays.</p>
2-
3-
<p>The overall run time complexity should be <code>O(log (m+n))</code>.</p>
4-
5-
<p>&nbsp;</p>
6-
<p><strong class="example">Example 1:</strong></p>
7-
8-
<pre><strong>Input:</strong> nums1 = [1,3], nums2 = [2]
9-
<strong>Output:</strong> 2.00000
10-
<strong>Explanation:</strong> merged array = [1,2,3] and median is 2.
11-
</pre>
12-
13-
<p><strong class="example">Example 2:</strong></p>
14-
15-
<pre><strong>Input:</strong> nums1 = [1,2], nums2 = [3,4]
16-
<strong>Output:</strong> 2.50000
17-
<strong>Explanation:</strong> merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5.
18-
</pre>
19-
20-
<p>&nbsp;</p>
21-
<p><strong>Constraints:</strong></p>
22-
23-
<ul>
24-
<li><code>nums1.length == m</code></li>
25-
<li><code>nums2.length == n</code></li>
26-
<li><code>0 &lt;= m &lt;= 1000</code></li>
27-
<li><code>0 &lt;= n &lt;= 1000</code></li>
28-
<li><code>1 &lt;= m + n &lt;= 2000</code></li>
29-
<li><code>-10<sup>6</sup> &lt;= nums1[i], nums2[i] &lt;= 10<sup>6</sup></code></li>
30-
</ul>
31-
</div>
Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +0,0 @@
1-
<h2><a href="https://leetcode.com/problems/longest-palindromic-substring/">5. Longest Palindromic Substring</a></h2><h3>Medium</h3><hr><div><p>Given a string <code>s</code>, return <em>the longest</em> <span data-keyword="palindromic-string"><em>palindromic</em></span> <span data-keyword="substring-nonempty"><em>substring</em></span> in <code>s</code>.</p>
2-
3-
<p>&nbsp;</p>
4-
<p><strong class="example">Example 1:</strong></p>
5-
6-
<pre><strong>Input:</strong> s = "babad"
7-
<strong>Output:</strong> "bab"
8-
<strong>Explanation:</strong> "aba" is also a valid answer.
9-
</pre>
10-
11-
<p><strong class="example">Example 2:</strong></p>
12-
13-
<pre><strong>Input:</strong> s = "cbbd"
14-
<strong>Output:</strong> "bb"
15-
</pre>
16-
17-
<p>&nbsp;</p>
18-
<p><strong>Constraints:</strong></p>
19-
20-
<ul>
21-
<li><code>1 &lt;= s.length &lt;= 1000</code></li>
22-
<li><code>s</code> consist of only digits and English letters.</li>
23-
</ul>
24-
</div>

final/0006-zigzag-conversion.html

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +0,0 @@
1-
<h2><a href="https://leetcode.com/problems/zigzag-conversion/">6. Zigzag Conversion</a></h2><h3>Medium</h3><hr><div><p>The string <code>"PAYPALISHIRING"</code> is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)</p>
2-
3-
<pre>P A H N
4-
A P L S I I G
5-
Y I R
6-
</pre>
7-
8-
<p>And then read line by line: <code>"PAHNAPLSIIGYIR"</code></p>
9-
10-
<p>Write the code that will take a string and make this conversion given a number of rows:</p>
11-
12-
<pre>string convert(string s, int numRows);
13-
</pre>
14-
15-
<p>&nbsp;</p>
16-
<p><strong class="example">Example 1:</strong></p>
17-
18-
<pre><strong>Input:</strong> s = "PAYPALISHIRING", numRows = 3
19-
<strong>Output:</strong> "PAHNAPLSIIGYIR"
20-
</pre>
21-
22-
<p><strong class="example">Example 2:</strong></p>
23-
24-
<pre><strong>Input:</strong> s = "PAYPALISHIRING", numRows = 4
25-
<strong>Output:</strong> "PINALSIGYAHRPI"
26-
<strong>Explanation:</strong>
27-
P I N
28-
A L S I G
29-
Y A H R
30-
P I
31-
</pre>
32-
33-
<p><strong class="example">Example 3:</strong></p>
34-
35-
<pre><strong>Input:</strong> s = "A", numRows = 1
36-
<strong>Output:</strong> "A"
37-
</pre>
38-
39-
<p>&nbsp;</p>
40-
<p><strong>Constraints:</strong></p>
41-
42-
<ul>
43-
<li><code>1 &lt;= s.length &lt;= 1000</code></li>
44-
<li><code>s</code> consists of English letters (lower-case and upper-case), <code>','</code> and <code>'.'</code>.</li>
45-
<li><code>1 &lt;= numRows &lt;= 1000</code></li>
46-
</ul>
47-
</div>

final/0007-reverse-integer.html

Whitespace-only changes.

final/0008-string-to-integer-atoi.html

Whitespace-only changes.

final/0009-palindrome-number.html

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +0,0 @@
1-
<h2><a href="https://leetcode.com/problems/palindrome-number/">9. Palindrome Number</a></h2><h3>Easy</h3><hr><div><p>Given an integer <code>x</code>, return <code>true</code><em> if </em><code>x</code><em> is a </em><span data-keyword="palindrome-integer"><em><strong>palindrome</strong></em></span><em>, and </em><code>false</code><em> otherwise</em>.</p>
2-
3-
<p>&nbsp;</p>
4-
<p><strong class="example">Example 1:</strong></p>
5-
6-
<pre><strong>Input:</strong> x = 121
7-
<strong>Output:</strong> true
8-
<strong>Explanation:</strong> 121 reads as 121 from left to right and from right to left.
9-
</pre>
10-
11-
<p><strong class="example">Example 2:</strong></p>
12-
13-
<pre><strong>Input:</strong> x = -121
14-
<strong>Output:</strong> false
15-
<strong>Explanation:</strong> From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
16-
</pre>
17-
18-
<p><strong class="example">Example 3:</strong></p>
19-
20-
<pre><strong>Input:</strong> x = 10
21-
<strong>Output:</strong> false
22-
<strong>Explanation:</strong> Reads 01 from right to left. Therefore it is not a palindrome.
23-
</pre>
24-
25-
<p>&nbsp;</p>
26-
<p><strong>Constraints:</strong></p>
27-
28-
<ul>
29-
<li><code>-2<sup>31</sup>&nbsp;&lt;= x &lt;= 2<sup>31</sup>&nbsp;- 1</code></li>
30-
</ul>
31-
32-
<p>&nbsp;</p>
33-
<strong>Follow up:</strong> Could you solve it without converting the integer to a string?</div>

0 commit comments

Comments
 (0)