Help Regarding MAXNUM3 (OCT Lunchtime)

MAXNUM3 ATTEMPT : This is my attempt at MAXNUM3 from this lunchtime. I am getting WA in both the cases. Can Anyone please tell me where I am making a mistake? Thanks :slight_smile:

N is very huge, 10^5 digits, you canโ€™t store it in long long. Need to use strings.

Thanks, I just read that n is no. of digits . I got confused with A and nโ€ฆ My Bad