My code is not getting accepted for test case no 1 please help

https://ide.codingblocks.com/s/321833,
hey there, im trying to return the arr of the indices, and idk why my code is not getting accepted , plz help , and reply asap

hi bhavya,
Your logic is right but there is small mistake in your code.
sizeof(ans)/sizeof(int) This will return the size of array if array is declared statically e.g. int ar[10]; and Moreover sizeof(ans)/sizeof(int) can only return array size if the instruction is used in same function in which array is declared.
Here is the code https://ide.codingblocks.com/s/321991.