In ALLINDICES PROBLEM i am getting the wrong answer though i am doing the same way it was taught

link:

Hi @shantanu.kaushik21,you have done a small error in line 23 that you have printed arr[i] but instead you have to print ans[i] and there should be space between the 2 outputs.Here have a look: