@17manishms hello Manish, it should be a[i-1]
i have modified to a[i-1] but again it is giving me wrong ans
@17manishms this will remain i only.