Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b2cfbe0

Browse files
author
Shuo
authored
Merge pull request #416 from openset/develop
Update: description
2 parents 31a3ae4 + 7d4b1e7 commit b2cfbe0

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

‎problems/self-crossing/README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,42 @@
1515

1616
<p>Write a one-pass algorithm with <code>O(1)</code> extra space to determine, if your path crosses itself, or not.</p>
1717

18+
<p>&nbsp;</p>
19+
1820
<p><b>Example 1:</b></p>
1921

2022
<pre>
21-
<strong>Input: </strong><code>[2,1,1,2]</code>
22-
23-
?????
24-
? ?
25-
???????&gt;
26-
?
23+
<strong>┌───┐
24+
&nbsp;
25+
└───┼──&gt;
26+
&nbsp; &nbsp;
2727

28-
<strong>Input: </strong>true
29-
<strong>Explanation:</strong>&nbsp;self crossing
28+
Input: </strong><code>[2,1,1,2]</code>
29+
<strong>Output: </strong>true
3030
</pre>
3131

3232
<p><b>Example 2:</b></p>
3333

3434
<pre>
35-
<strong>Input:</strong> <code>[1,2,3,4]</code>
36-
37-
????????
38-
? ?
39-
?
40-
?
41-
?????????????&gt;
35+
<strong>┌──────┐
36+
&nbsp; &nbsp; &nbsp;
37+
38+
39+
└────────────&gt;
4240

41+
Input:</strong> <code>[1,2,3,4]</code>
4342
<strong>Output: </strong>false
44-
<strong>Explanation: </strong>not self crossing
4543
</pre>
4644

4745
<p><b>Example 3:</b></p>
4846

4947
<pre>
50-
<strong>Input:</strong> <code>[1,1,1,1]</code>
51-
52-
?????
53-
? ?
54-
?????&gt;
48+
<strong>┌───┐
49+
&nbsp;
50+
└───┼&gt;
5551

52+
Input:</strong> <code>[1,1,1,1]</code>
5653
<strong>Output:</strong> true
57-
<strong>Explanation:</strong>&nbsp;self crossing
5854
</pre>
5955

6056
### Related Topics

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /