Skip to content

Commit 3df8737

Browse files
committed
added doctest
1 parent 57abc1a commit 3df8737

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

data_structures/arrays/dutch_national_flag.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ def dutch_national_flag(arr: list[int]) -> list[int]:
77
88
Returns:
99
list[int]: Sorted array
10+
11+
Examples:
12+
>>> dutch_national_flag([2, 0, 2, 1, 2, 0, 1])
13+
[0, 0, 1, 1, 2, 2, 2]
14+
>>> dutch_national_flag([0, 1, 2, 0, 1, 2])
15+
[0, 0, 1, 1, 2, 2]
16+
>>> dutch_national_flag([1, 1, 1])
17+
[1, 1, 1]
18+
>>> dutch_national_flag([])
19+
[]
1020
"""
1121

1222
low, mid, high = 0, 0, len(arr) - 1

0 commit comments

Comments
 (0)