My Blog List

[Leetcode Solution] Sort Colors

Analysis 

Note

Code


UPDATED AT LEETCODE 2ND PASS
NOTE:
when swap two elements in an array, if these two elements are the same one, error would happen.
Thus when implement swap function, checking whether two elements are the same is needed UPDATED AT LEETCODE 3ND PASS after been asked this question at FB interview

2 comments:

Enter you comment