Skip to content

Commit 87dac54

Browse files
committed
Update topics
1 parent ae9a41f commit 87dac54

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

topic/language/python/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ Python Syntax Note
88
`is` will return True if two variables point to the same object,
99
`==` if the objects referred to by the variables are equal.
1010

11+
- example in `int` and `float`
12+
13+
note that, negative `int`/`float` is special case.
14+
15+
```python
16+
>>> 10 != 10
17+
False
18+
>>> 10 is not 10
19+
False
20+
>>> 0 != 0
21+
False
22+
>>> 0 is not 0
23+
False
24+
>>> -9 != -9
25+
False
26+
>>> -9 is not -9
27+
True
28+
```
29+
1130
- example in `str` and `bytes`
1231

1332
```python

topic/linked_list/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ Linked List
2525
```python
2626
>>> cur = None
2727
>>> while head:
28-
... cur, cur.next, head = head, cur, head.next
28+
... head.next, cur, head = cur, head, head.next
2929
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- minimum length:
2+
3+
```
4+
while cnt == k:
5+
# reduce window size if possible
6+
# and record it
7+
```
8+
9+
- maximum length:
10+
11+
```
12+
while cnt > k:
13+
# to evict invalid start
14+
15+
# it's valid here, so record the maximum window size
16+
```

0 commit comments

Comments
 (0)