This method is only viable for array with only 0, 1, 2 as values

It will not work in every case, right?

Hi Vivek… this code is only for arrays containing 0,1,2.

okay, thank you 4 ur help

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.