Skip to content

Commit 411e272

Browse files
authored
Add question explanation
1 parent 6e0edb6 commit 411e272

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

data_structures/array/dutch_flag_problem.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Given an array containing only 0s, 1s and 2s in a random order, arrange the array such that all 0s come
2+
# before 1s which in turn come before all 2s
3+
# Input - [1,2,0,1,2,1,0,1,2,1,0]
4+
# Output - [0,0,0,1,1,1,1,1,2,2,2]
5+
16
def dutch(arr):
27
low = 0
38
mid = 0

0 commit comments

Comments
 (0)