Whats wrong with my code?

hello @akash_281

initilaise ur ans array till index n.