Counting sort on this question

will using counting sort on this question be correct, i.e will it meet the time & space complexity constraints ??

Hey @magnus2001
simple use 3 pointer Approach ( Dutch National Flag Algorithm)
ya you can try counting sort