code- https://ide.codingblocks.com/s/270711
it was not able to get the output format
I cant get the output format
hello @anubhavb11
output should be in sorted order.
and it should start with [
then comma separated numbers
and then ].
refer this->

i managed to get the ans in sorted order but i cant able to print in the output format please check my code i have written it but how can i stop it from putting comma at the last position.
code- https://ide.codingblocks.com/s/270893
can you please help me out
dont use for each loop.
use simple loop .
iterate from i=0 to i=n-1.
and print comma only when i!=n-1.
but i dont know how to itrate over hashmap using for loop

here when i==n-1 and ur m[arr2[i]]==0 then dont print comma
here you are itrating over a array and i need to itrate over a hashmap kindly look at my code if you can help me in that
and this will not give ans because we want ans in sorted order
that is ur code only.
kindly check ur code again.
no need to iterate over map.
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.
