my answer is getting some random garbage value
Error in code of this question
u have cout too many statement
u only have to cout the required thing which were asked
also ur cin is wrong when type[i]==1 u dont have to cin>> as u can see in test case
thats why garbage value is coming
check this
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.