Plz correct this code

@rakesh800650
There were two mistakes.

  1. you did not do cin>>n;
  2. cnt[] was not initialised to 0, therefore it may contain garbage value.
    https://ide.codingblocks.com/s/233785

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.