forked from doocs/leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
122 lines (51 loc) · 2.12 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import html2md
import tomd
my_str = """# [854. K-Similar Strings](https://leetcode.com/problems/k-similar-strings)
## Description
<p>Strings <code>A</code> and <code>B</code> are <code>K</code>-similar (for some non-negative integer <code>K</code>) if we can swap the positions of two letters in <code>A</code> exactly <code>K</code> times so that the resulting string equals <code>B</code>.</p>
<p>Given two anagrams <code>A</code> and <code>B</code>, return the smallest <code>K</code> for which <code>A</code> and <code>B</code> are <code>K</code>-similar.</p>
<p><strong>Example 1:</strong></p>
<pre>
<strong>Input: </strong>A = <span id="example-input-1-1">"ab"</span>, B = <span id="example-input-1-2">"ba"</span>
<strong>Output: </strong><span id="example-output-1">1</span>
</pre>
<div>
<p><strong>Example 2:</strong></p>
<pre>
<strong>Input: </strong>A = <span id="example-input-2-1">"abc"</span>, B = <span id="example-input-2-2">"bca"</span>
<strong>Output: </strong><span id="example-output-2">2</span>
</pre>
<div>
<p><strong>Example 3:</strong></p>
<pre>
<strong>Input: </strong>A = <span id="example-input-3-1">"abac"</span>, B = <span id="example-input-3-2">"baca"</span>
<strong>Output: </strong><span id="example-output-3">2</span>
</pre>
<div>
<p><strong>Example 4:</strong></p>
<pre>
<strong>Input: </strong>A = <span id="example-input-4-1">"aabc"</span>, B = <span id="example-input-4-2">"abca"</span>
<strong>Output: </strong><span id="example-output-4">2</span></pre>
</div>
</div>
</div>
<p><strong>Note:</strong></p>
<ol>
<li><code>1 <= A.length == B.length <= 20</code></li>
<li><code>A</code> and <code>B</code> contain only lowercase letters from the set <code>{'a', 'b', 'c', 'd', 'e', 'f'}</code></li>
</ol>
## Solution
<!-- Type common method here -->
### Python3
<!-- Type special method here -->
```python
```
### Java
<!-- Type special method here -->
```java
```
### ...
```
```
"""
print(html2md.convert(my_str))